Skip to content

Commit

Permalink
Small doc updates (#3)
Browse files Browse the repository at this point in the history
* Need to call `get_links`

* I **think** this doesn't work as the code suggests now

* Fix typeo
  • Loading branch information
jefromyers authored Jun 10, 2024
1 parent c99f503 commit 8c0be03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
20 changes: 1 addition & 19 deletions book/src/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ from spider_rs import Website
async def main():
website = Website("https://jeffmendez.com")
website.crawl()
print(website.links)
# print(website.pages)
print(website.get_links())

asyncio.run(main())
```
Expand Down Expand Up @@ -63,20 +62,3 @@ async def main():
website = Website("https://choosealicense.com")
website.crawl(Subscription())
```

## Shortcut

You can use the `crawl` shortcut method to collect contents quickly without configuration.

```ts
import asyncio

from spider_rs import crawl

async def main():
website = crawl("https://jeffmendez.com")
print(website.links)
# print(website.pages)

asyncio.run(main())
```
6 changes: 3 additions & 3 deletions book/src/website.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import asyncio
from spider_rs import Website

async def main():
website = Website("https://choosealicense.com").with_tlds(True)
website = Website("https://choosealicense.com").with_tld(True)

asyncio.run(main())
```
Expand Down Expand Up @@ -247,8 +247,8 @@ async def main():
website = (
Website("https://google.com")
.with_openai({
"model": "gpt-3.5-turbo",
"prompt": "Search for movies",
"model": "gpt-3.5-turbo",
"prompt": "Search for movies",
"maxTokens": 300
})
)
Expand Down

0 comments on commit 8c0be03

Please sign in to comment.