Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the difference between Selenium and "Requests"? #108

Closed
MRizkBV opened this issue Dec 14, 2020 · 1 comment
Closed

What's the difference between Selenium and "Requests"? #108

MRizkBV opened this issue Dec 14, 2020 · 1 comment

Comments

@MRizkBV
Copy link
Contributor

MRizkBV commented Dec 14, 2020

I am unaware as what is the difference between both methods. I used to use another script here on GitHub (Jef/streetmerchant) and moved to this one recently as it is much much better. I was able to add several shops on the other script though and wanted to fully migrate to this one but I wanted to know the difference between both methods first.

Also any chance we can have an out of stock indicator? Some shops may be hard to implement with just an in stock indicator like AMD.com. When viewing a RX 6800 XT link for example, it would show that Radeon is out of stock but suggest you buy a Ryzen 3900X instead showing an add to cart button. This would trigger the bot as the add to cart container is not unique AFAIK.

An out of stock indicator would ignore any in stock indicator if found. This is to help deter false positives.

@EricJMarti
Copy link
Owner

Requests is a lightweight HTTP library for python, and it works great on simple websites such as Newegg. However, some websites can detect that these HTTP requests are not coming from a real browser. That's where selenium comes in handy; it can spin up a browser and use it to navigate to webpages. Since this is overkill for a lot of websites, I kept both approaches.

Regarding your second question: this tool works best when there is a specialized scraper for each website you plan to use it with. For instance, this is the most recent addition: 6504842

A specialized scraper would be able to ignore the add to cart buttons for related products. I am working on a wiki page with instructions for how to write your own scraper.

@MRizkBV MRizkBV closed this as completed Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants