scrapeByXPath
Scrape any part of a webpage using the XPath.
Check this article on how to scrape web pages using XPath.
Basically, if you click on the element that you want to scrape, right click > inspect element then a sidebar will appear. Right click on the HTML element that you've inspected and click on Copy > Copy Xpath.
That's it! You'll have the XPath copied in your clipboard

How to obtain the xPath from a browser
This function spends 1 credit per execution
Scraping one NPM repository with xPath
- url: The URL you want to scrape (i.e.
https://www.domain.com/path-1
) - scrapeSeveralElements: Set to True if you want to scrape several elements. For default is set to False so it will scrape only the first element
- xPath: The xpath to select the element you want to scrape (i.e.
//div[@id="id"]
) - method The method to use to get the element (i.e.
getText
).
- string: The element you want to scrape
scrapeByXPath("https://www.npmjs.com/package/seo-scraper", TRUE, "//h2", "getText")
// seo-scraper
// Installing
// Get started with default config
// Custom Configuration
// Custom scraping example
// Transformers
// Keywords
- Scrape any website from Google Sheets
Last modified 4mo ago