Scraping Webpage
Publish date: Jul 29, 2019
Last updated: Apr 22, 2020
Last updated: Apr 22, 2020
Scrape info from webpages using xpaths
Want to scrape all character names from game of thrones show
$x('//*[@id="mw-content-text"]/div/table[2]/tbody/tr/td[2]/a/text()').forEach(function(el){console.log(el)})
$x("//td[@class="first"]/a").map(function(el){return el.text}).join("\n")
- Select the information you want using
xpath
- print output to console
- save output to a file1
Footnotes
[^2]: