Bridges and actions¶
Bridges are site-specific scrapers that tell Persine what to click and what to scrape. In order for Persine to successfully understand a site, it needs a bridge for that site.
When you visit a URL, the bridge for that domain is used to processed the page. Bridges are also in charge of site-specific commands such as youtube:like
.
Note
If you’d like an action to repeat multiple times you can append #[NUMBER]
to the action name. For example, youtube:next_up#50
will watch the next fifty “next up” videos.
YouTube¶
The YoutubeBridge
is a general-purpose YouTube scraper. Can pull recommendations from the homepage, search results, and video pages.
Actions¶
Action |
Description |
|
Visit youtube.com |
|
Search YouTube for the specified term |
|
When on a video page, click the “next up” video |
|
Click the like button |
|
Click the dislike button |
|
Click the subscribe button |
|
Click the unsubscribe button |
|
Begin the signin process – you’ll need to complete the process manually, but Persine will resume as soon as it notices you’re logged in |
Amazon¶
The AmazonBridge
is still in development, but here’s what it can do so far.
Actions¶
Action |
Description |
|
Visit amazon.com |
|
Search Amazon for the specified term |
|
Visit the page for a given ASIN |
Adding new bridges¶
Bridges are easy to add! Take a look at the Amazon one as an example – all you really need to implement to build your own is .run
that returns data from the page. It’s easy to scrape using Selenium or by running JavaScript on the page itself and returning the results.