Reputation: 8528
I am working on a website scraping project using Selenium in Python. I am wondering if I can start the firefox in the backend or open Firefox in another workspace in Ubuntu ?
Is it also possible to pass the user-agent
properties though the webdriver() ?
Thanks
Upvotes: 2
Views: 1705
Reputation: 33901
PyVirtualDisplay should let you run it in the background.
There's a short walkthough here.
And yes, you can change the User Agent.
Upvotes: 3
Reputation: 110
If you're using Gnome you might want to try DevilsPie (or gDevilsPie) to control on which workspace Firefox runs:
A simple RAW rule would be:
( if
( begin
( is ( application_name ) "Firefox" )
)
( begin
( set_workspace 3 )
( println "match" )
)
)
I use this with Selenium and it works quite well.
Upvotes: 1