Skip to content

Latest commit

 

History

History
72 lines (59 loc) · 1.08 KB

README.md

File metadata and controls

72 lines (59 loc) · 1.08 KB

Web-Scraper

A wrap of the popular scraper crate.

Integrate

1. Polywrap Setup

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

2. Run The Wrap

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: "...")
)