Can phython with selenium be minimized?

EagerToEarn

Regular Member
Joined
Jun 4, 2017
Messages
380
Reaction score
100
(Optional Paragraph) I am learning phython but before learning I was decided to go Java(and straight up no to 'C' oriented programming cuz Java is still easier, I want to choose EASY language first)
I know, #c is boss but I want programming just for like bots,web design,etc.


Phython suits for my needs. But hearing that while using selenium(kinda slow) you CANT MINIMIZE.
Bots is needed to be minimized most of the time.

I heard that you can resize selenium web browser to small size that will hide the window.
Does losing focus on the web browser stops it? And can I run 10 to 8 RESIZED selenium web browser without compromising anything inside selenium.
 
From my exp, never know if python selenium have minimize function while running..
"driver.set_window_position(x, x)" <== Only move
but try to watch phantomjs.. "webdriver.PhantomJS()"
if your bot can run without javascript interaction.. maybe scrapy or mechanize will suit for you..

maybe other python expert on bhw have good exp then me.. can give you other suggestion..
 
Thank you very much. I know about phantomjs have JavaScript problem. Will check scrapy and mechanize.

Consider if Making (selenium+phython+Firefox) webdriver not active window(I mean this webdriver window is in running background) and Like if it is out of screen sight,will have any negative effect on the bot I'm running?

can I run more than one webdriver with different .py program? Sorry this is stupid question.

I'm no expert just wanted to before getting deep into phython. I'm thankful will always remember you in the future.
 
I'm not really expert in selenium, but for your question about effect. As i know selenium only can run if windows in active mode. it's no problem if in your view screen or out screen.
but i hear combine with diferrent python module will make better.
about effect.. i think only if you run selenium with multiple session..you will need more resource.
about 1 webdrive with different py, yes.. but better if you make 1 script handle different function with multiple session.

already create sample case using scrapy if you want :
https://www.blackhatworld.com/seo/create-simple-python-scraper-bot-with-scrapy.946490/
 
Use requests instead of selenium, its much faster and headless.
 
use windows position -2000 - 2000

it works for me,

some tips,
You can:
Hide logging windowing
use invisible browser (headless) with all same code (but i havent tried it yet because i was working with facebook bot)
 
Don't use selenium.. Its such a hell for your comp's memory. With requests xou could make even 5-10 threads with diff proxies.
 
Don't use selenium.. Its such a hell for your comp's memory. With requests xou could make even 5-10 threads with diff proxies.

selenium is cool for rapid dev when you are looking for a quick fix solution for your automation needs.

and not all websites can be automated in a headless environment with ease.

also we have huge memory on most systems these days, never felt I was low on ram so far when using selenium for my custom made IM bots.
 
Use requests instead of selenium, its much faster and headless.
I am a python programmer but I think requests does not handle javascripts and selenium + python + firefox needs a lot of resource.

Is there any other module that handles javascript very well and is lightweight?
 
In my experience there is one site which you can't automate with requests, that pinterest. You don't need all js scripts to run. I made many bots with requests, twitter, tumblr, xvideosuploaddr, xhamsterdownloader, and i didnt have any problem with js scripts, on the other hand you could bypass js logins and etc with connect selenium with requests, all you need to do is pass cookies from selenium to requests, and close selenium to not to slow your pc.
 
In my experience there is one site which you can't automate with requests, that pinterest. You don't need all js scripts to run. I made many bots with requests, twitter, tumblr, xvideosuploaddr, xhamsterdownloader, and i didnt have any problem with js scripts, on the other hand you could bypass js logins and etc with connect selenium with requests, all you need to do is pass cookies from selenium to requests, and close selenium to not to slow your pc.
ok thanks
 
In my experience there is one site which you can't automate with requests, that pinterest. You don't need all js scripts to run. I made many bots with requests, twitter, tumblr, xvideosuploaddr, xhamsterdownloader, and i didnt have any problem with js scripts, on the other hand you could bypass js logins and etc with connect selenium with requests, all you need to do is pass cookies from selenium to requests, and close selenium to not to slow your pc.
how do you view browser requests when programming bots Wirth python requests? If you use any app in viewing the request please name it here.
 
@atosz33
Can you also automate Facebook just with requests? Or do you need an open browser and selenium for doing all the actions on the webelements (clicking, writing, ...)?
 
I think it could be fully automated with requests. Nearly all site could be automatised with it, i built many bots twitter, tumblr, xvideos xhamster, so probably facebook easily can be done
 
8gb ram pc with 4 core i5 somewhat newer cpu can run about 15 selenium bots at once
 
Then? And can about 200-500 instances of requests, requests alway headless ( ok I know there is phantomjs but that have limitations). And selenium have high error rate if you use your computer. I know, i am working at an IT company and our main job to automate and test sites
 
Then? And can about 200-500 instances of requests, requests alway headless ( ok I know there is phantomjs but that have limitations). And selenium have high error rate if you use your computer. I know, i am working at an IT company and our main job to automate and test sites
true, but for bot making selenium is very handy, because it looks like a real human is interacting with the website/app
 
Back
Top