https://github.com/polywrap/web-scraper
https://github.com/polywrap/web-scraper
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/polywrap/web-scraper
- Owner: polywrap
- Created: 2023-07-05T19:55:42.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T13:55:40.000Z (over 2 years ago)
- Last Synced: 2023-09-27T04:00:27.366Z (over 2 years ago)
- Language: Rust
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Web-Scraper
A wrap of the popular [scraper](https://crates.io/crates/scraper) crate.
## Integrate
### 1. Polywrap Setup
`polywrap.graphql`:
```graphql
#import * into WebScraper from "wrapscan.io/polywrap/web-scraper@1"
```
`polywrap.yaml`:
```yaml
format: 0.3.0
project:
name: my-app
type: app/typescript|python|rust|kotlin|swift
source:
schema: ./polywrap.graphql
```
Codegen:
```bash
$ polywrap codegen
```
### 2. Run The Wrap
`app/typescript`:
```typescript
const webScraper = new WebScraper();
await webScraper.get_text({
url: "...",
});
```
`app/python`:
```python
web_scraper = WebScraper()
result = web_scraper.get_text({
"url": "..."
})
```
`app/rust`:
```rust
let web_scraper = WebScraper::new();
let result = web_scraper.get_text(
&WebScraperArgsGetText{
url: "..."
}
).unwrap();
```
`app/kotlin`:
```kotlin
val webScraper = WebScraper(client)
val result = webScraper.get_text(
WebScraperArgsGetText("...")
).getOrThrow()
```
`app/swift`:
```swift
let web_scraper = WebScraper()
try? web_scraper.get_text(
args: WebScraperArgsGetText(url: "...")
)
```