ballerinax/webscraping.ai Ballerina library
This is a generated connector for WebScraping.AI API v2.0.4 OpenAPI specification. It provides a web scaping automation API with Chrome JS rendering, rotating proxies and builtin HTML parsing. More information about the WebScraping.AI API can be found at https://webscraping.ai.
Before using this connector in your Ballerina application, complete the following:
- Create WebScraping.AI account
- Obtain tokens
- Log into WebScraping.AI API Dashboard by visiting https://webscraping.ai/dashboard
- Obtain the
API Keyfrom the dashboard
To use the WebScraping.AI connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the
ballerinax/webscraping.ai module into the Ballerina project.
Step 2: Create a new connector instance
ai:ApiKeysConfig with the API Key obtained, and initialize the connector with it.
Step 3: Invoke connector operation
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to page HTML by URL using the connector. You can now get full HTML content of a page with proxies and Chrome JS rendering.
Page HTML by URL
Following is an example on how to get HTML of a selected page area by URL and CSS selector using the connector. You can now get HTML content of selected page areas (like price, search results, page title, etc.).
Get HTML of a selected page area by URL and CSS selector
bal runcommand to compile and run the Ballerina program.
Released date: 10 months ago
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Current verison: 1