Đã Đóng

Code a simple Node.js script to extract data from HTML


Your task is to write a simple Javascript function that extracts certain data from the rows of an HTML table and returns the data as an array of Javascript objects. The function will be executed in a Node.js environment.

This is a very simple project. If you are successful in bidding on this project, and you show yourself to be a professional freelancer, you will be asked to build on your work by completing a number of additional projects for additional pay.


• Your function will be executed using Node.js v6.11.1.

• Your function must be asynchronous.

• Your function must either (a) accept one argument and return a promise, or (b) accept two arguments, the second of which is a callback function.


• Your function will be called with a string containing HTML (less than 30 KB). If necessary, your function will also be passed a callback function in the standard form.

• The HTML will contain a table with two columns, and may contain rows with file numbers structured as described below. Your function should ignore any rows that do not contain file numbers.

• The first cell will contain one or more file numbers of the form /[A-Z]\d+\/\d{4}/ separated by line breaks. It will also contain a URL.

• The second cell will contain one or more file titles separated by line breaks.


• In this section, when we refer to your function returning a result, we are referring to your function either resolving a promise with the result or executing the callback function with the result, as appropriate.

• Your function must return an array. The array should contain an object for every file number in the HTML table.

• The objects in the array must appear in the same order as the file numbers appear in the table.

• Each object must contain three properties named "number", "title", and "url", corresponding to a file number and URL in the first cell, and a title in the second cell.

• If a row contains more than one file number and more than one title separated by line breaks, the title for each file number should be determined by the line breaks. If a row contains more titles than file numbers, subsequent file numbers in the same row should re-use the title of the previous file number in that row.

• If your function is unable to extract any file numbers, your function must return an empty array.


• Like all good developers, you should make as few assumptions about your input as possible.

• If you do make assumptions about your input, for example, by hardcoding observed features of the HTML, you should ensure that it is trivial to update your code in the event that any of those features is changed.

• You can use npm modules, but should do so sparingly.


Input: '<html></html>'

Output: []


Input: '<html xmlns="[url removed, login to view]" xml:lang="en-au" lang="en-au" dir="ltr"><body class="contentpane"><table class="cases"><tbody><tr><td><p><strong>File No.</strong></p></td><td><p><strong>Short Title</strong></p></td></tr><tr><td><a title="Burns" href="/files/file_z186-2017" target="_self">Z186/2017 <br>Z187/2017</a></td><td>Burns & Others </td></tr></tbody></table></body></html>'

Output: [{number: "Z186/2017", title:"Burns & Others", url:"/files/file_z186-2017"}, {number: "Z187/2017", title:"Burns & Others", url:"/files/file_z186-2017"}]


Further examples will be provided to the successful bidder.


Having taken the time to write a detailed specification that should be easy to follow, we expect your code to be similarly well-written and easy to read. We are looking for a professional freelancer who is capable of performing a variety of tasks of varying complexity efficiently and affordably.

Kĩ năng: Javascript, node.js

Xem nhiều hơn: simple node.js, java script back end node js consultant outsourcer, perl script extract data html page, script scrape data url, vba script scrape data website, php script extract data html table, python script scrape data, python script scrape market data, need script will scrape pertinent data, simple web crawler script code php, simple php script extracting website data, simple js script, js script data mining, javascript return data perl script, script scrape data web python, script scrape data websites, php script scrape site data, script extract data html perl mysql, html script extract data email, simple script extract data urls, extract data html script, regular expressions extract data html, javascript extract data html table, extract data html table, extract data html table php

Về Bên Thuê:
( 0 nhận xét ) Sydney, Australia

ID dự án: #14941560

50 freelancer đang chào giá trung bình $25/giờ cho công việc này


Dear Sir, I have read everything & consulted with my technical team lead, so we can do this project in 30 Man-Hours. Please let me know if you are comfortable with it? Just so you know I am flexible in prices, as Thêm

$22 AUD / giờ
(8 Nhận xét)
$22 AUD / giờ
(5 Nhận xét)

Hi James King, By reviewing your examples, We are experts in JavaScript. So The function extracts data from HTML table and also returns data as an array of JavaScript objects will be definitely done by us as well as Thêm

$15 AUD / giờ
(31 Nhận xét)

Dear sir. I have full experience in PHP,javascript, MySql, HTML5 and Many php frameworks. I have developed school management website, shopping cart and e-commerce project. If you hire me, I will do my best to work on Thêm

$21 AUD / giờ
(35 Nhận xét)

Hi, Hope you are doing fine, Let me keep this really short as I am sure you would be swamped with the proposals. We have been developing/maintaining various web applications in NodeJS (both Express and Sails). Thêm

$20 AUD / giờ
(8 Nhận xét)
$25 AUD / giờ
(67 Nhận xét)

Hi, nice to meet you. I have mastered NodeJS. I would like to work for you. I have been through your requirements. Please ping me if you are in terested in my working. Huang

$15 AUD / giờ
(13 Nhận xét)

Hello. I'm very interesting with your post. I'm individual developer working fulltime as freelancer. I have many experienced with javascript, nodejs and regex, cheerio in nodejs. I can do this job and give you expec Thêm

$24 AUD / giờ
(55 Nhận xét)

"Experienced in Node.js" Required skillset examples: - WebGuardians [url removed, login to view] - Solutioners [url removed, login to view] - TIP7 Web ba Thêm

$21 AUD / giờ
(7 Nhận xét)

Good day, Professional freelancer at your service. I have read your detailed specs and would love to be part of your project and show myself as valuable for future work. I have understood the main idea of the task a Thêm

$25 AUD / giờ
(21 Nhận xét)

Hello, We have great experience on node js. I understand you need a Node.js script to extract data from HTML. I have reviewed complete job post and willing to discuss further. We are ready to take your project & bu Thêm

$20 AUD / giờ
(15 Nhận xét)

Hello! My name is Maksim, from Kiev, Ukraine (UTF + 2) We are IntoBi - hardworking and responsible team. Our developers have highly experience in the building of various websites and apps. Our team has excellent Thêm

$27 AUD / giờ
(1 Nhận xét)

Hi, 100% Completion Rate!!! Hi,I read your description carefully. I am very interest your job. I have rich experience for the web development I will make your app perfectly. Please check my work history on Freelance Thêm

$33 AUD / giờ
(4 Nhận xét)

A proposal has not yet been provided

$15 AUD / giờ
(59 Nhận xét)

Hi there, I’d like to be considered for your job position. I’m a Web Developer with a strong background developing with back end & front end. My expertise skills are Php, CakePhp, WordPress, CodeIgniter,Joomla, Angul Thêm

$15 AUD / giờ
(8 Nhận xét)

Hi, Good day! We have gone through your post and would like to discuss as we have NodeJs experts in our company who have extensive experience in designing and developing applications using HTML, CSS etc. Plea Thêm

$15 AUD / giờ
(12 Nhận xét)

Hello, my name is Michael. I represent Ukrainian based IT-company Webbook Inc that provides services in the IT-sphere for international business. We were carefully reviewing the requirements of the job description, so Thêm

$28 AUD / giờ
(9 Nhận xét)

Hi there, Thank you for sharing your requirement. We are a team of technocrats having 8+ years of experience in Web and Mobile design plus development. Talking about our expertise, we possess very good expertise Thêm

$20 AUD / giờ
(9 Nhận xét)

Hello, I am so glad to bid your project. I fully understood your requirement and it seems great idea. I have full experiences of developing javascript apps. I would like to discuss about more details with you. Bes Thêm

$22 AUD / giờ
(1 Nhận xét)

Hi Let's clarify the requirement in details also if you want us to share our previous work let us [url removed, login to view] have a few questions about your project, please send us message so that we can discuss more. Thanks & regards Thêm

$20 AUD / giờ
(23 Nhận xét)