Requests vs Selenium

Status
Not open for further replies.
Use an extension, virtualize all javascript on the page, and launch the browser hidden. Jesus, too easy. :-P
 
Or if you think it's really worth it, reverse engineer the javascripts that does the fingerprinting, then do everything in requests module, or prefferably raw sockets.
 
I think there is a misunderstanding, I agree with you fully. Using Requests should be the first tool used due to far less resource usage. I've profiled Requests vs Selenium, and we are talking 100X more resource usage with Selenium. Plus, Selenium is cludgy to use, where reading a simple HTTP status code would suffice. I 100% prefer Requests, and would use 100% of the time if there weren't pages that require Javascript either due to rendering or fingerprinting.

Oh right then I am in agreement. I actually was under the same impression as you until someone informed me the other day that javascript can be bypassed just by looking at when it sends over the wire after it completes it client side activity. Took me a little to realise this because you need to look not at the root page's requests but rather the slew of requests that comes forth after you complete the js action and the url can be some weird random one which you would emulate.

I did this successfully only on one website so far- not that tried on any others yet- but I was told that you can bypass all js like this.

PS I see most other people here are ignorant as to how requests work and emulate browser activity 1:1 so no need to further the discussion with them. Let them stay in their webdriver bubble thinking they have the upper hand :)

I do use webdriver sometimes still but it is when I am pressed for time since sometimes it can be tricky to figure out that 1 request which will make the whole thing go and I need an email creator working for instance. If I had the luxury of time I would always at least try and do my bots in requests before moving to webdriver.
 
Oh right then I am in agreement. I actually was under the same impression as you until someone informed me the other day that javascript can be bypassed just by looking at when it sends over the wire after it completes it client side activity. Took me a little to realise this because you need to look not at the root page's requests but rather the slew of requests that comes forth after you complete the js action and the url can be some weird random one which you would emulate.

I did this successfully only on one website so far- not that tried on any others yet- but I was told that you can bypass all js like this.

PS I see most other people here are ignorant as to how requests work and emulate browser activity 1:1 so no need to further the discussion with them. Let them stay in their webdriver bubble thinking they have the upper hand :)

I do use webdriver sometimes still but it is when I am pressed for time since sometimes it can be tricky to figure out that 1 request which will make the whole thing go and I need an email creator working for instance. If I had the luxury of time I would always at least try and do my bots in requests before moving to webdriver.

Are you talking about looking at the HTTP post that is issued, or actually executing the JavaScript to force it to make the requests? If it is the latter, do you use some JS library to run the JavaScript? Seems easier than trying to mock the HTTP request via the requests module.

That's quite useful information!
 
Everything could and should be emulates using pure HTTP and reversing the .js
I have been able to scrape the biggest sites and biggest protections out there.

Selenium is shit and take lots of resources and easy to detect as well.
 
Everything could and should be emulates using pure HTTP and reversing the .js
I have been able to scrape the biggest sites and biggest protections out there.

Selenium is shit and take lots of resources and easy to detect as well.

True, would love to do everything pure HTTP, but how do you deal with minified JS? The var names are scrambled and the context is hard to gather.
 
True, would love to do everything pure HTTP, but how do you deal with minified JS? The var names are scrambled and the context is hard to gather.

Read a bit about js code obfuscation. you will have to reverse the whole code to understand exactly.
 
Status
Not open for further replies.
Back
Top