-3

In Python it is very simple: pandas.read_html("some URL");

I am wondering what's the best way to do this in Javascript. Is there some existing library that can help with this?

2
  • Does this answer your question? Perform curl request in javascript? Commented Feb 18, 2020 at 20:40
  • @caramba Not entirely sure. I guess I am looking for something simpler: scrapes all tables in a link and returns a list of tables. Commented Feb 18, 2020 at 20:46

1 Answer 1

1

You might want to take a look at DOMParser this will create a document object where you can perform any kind of manipulation as any normal html page.

example:

var doc = DOMParser.parseFromString("<html code here>", "text/html");
var tables = doc.querySelectorAll('table'); // returns NodeList

You should fetch the html string from another part of your program.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.