A wrap of the popular scraper crate.
polywrap.graphql
:
#import * into WebScraper from "wrapscan.io/polywrap/web-scraper@1"
polywrap.yaml
:
format: 0.3.0
project:
name: my-app
type: app/typescript|python|rust|kotlin|swift
source:
schema: ./polywrap.graphql
Codegen:
$ polywrap codegen
app/typescript
:
const webScraper = new WebScraper();
await webScraper.get_text({
url: "...",
});
app/python
:
web_scraper = WebScraper()
result = web_scraper.get_text({
"url": "..."
})
app/rust
:
let web_scraper = WebScraper::new();
let result = web_scraper.get_text(
&WebScraperArgsGetText{
url: "..."
}
).unwrap();
app/kotlin
:
val webScraper = WebScraper(client)
val result = webScraper.get_text(
WebScraperArgsGetText("...")
).getOrThrow()
app/swift
:
let web_scraper = WebScraper()
try? web_scraper.get_text(
args: WebScraperArgsGetText(url: "...")
)