Comments (7)
Helium has two functions : set_driver()
and get_driver()
. You can use a new selenium driver with the given arguments options to start helium with that given driver. For example :
from helium import *
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--incognito")
chrome_options.add_argument("--window-size=600,300")
# or max
# chrome_options.add_argument("--start-maximized")
driver = webdriver.Chrome("./chromedriver", options=chrome_options)
set_driver(driver)
get_driver()
go_to("google.com")
After calling set_driver()
there is no need to call start_chrome()
since set_driver()
already starts the given driver. Hope it helped.
I will probably add a PR later for suggesting that start_chrome()
or start_firefox()
take extra arguments for setting the drivers.
EDIT : code format
from helium.
Thank you @dntzbgh! Re the pr: before you spend time on this, could you explain why it would be better than set_driver
?
from helium.
I guess its more straightforward than creating the driver instance with selenium and then setting it up with set_driver()
. It will be much easier just to pass the arguments into start_chrome(url, options)
.
from helium.
I don't think such a PR would give any technical benefits, but it would certainly be much more usable to just set any extra arguments directly in start_chrome(url, options).
from helium.
Yeah, makes sense. Do you think you could add it for start_firefox
too @dntzbgh ?
from helium.
Hi, sorry for such a late response.
After thinking it better I think that what you have said in #9 makes sense. There are too many options and parameters to add it all one function and inserting it all in a webdriver.ChromeOptions
object to the parameter wont help that much since if you have already configured an webdriver.ChromeOptions
you might as well add it to a selenium driver and pass it to the set_driver()
function. This way you have more flexibility with initialization of the driver parameters.
from helium.
I've added an options
parameter to start_chrome
now. Please see release 3.0.2.
from helium.
Related Issues (20)
- AttributeError: 'NoneType' object has no attribute 'location'
- Latest Helium Version and Selenium 4 dependency conflicts
- I have a question about automatically switching frames to find elements
- This version of ChromeDriver only supports Chrome version 89 HOT 1
- options not working.
- incompatible with latest selenium version HOT 1
- incompatible with latest version of chrome HOT 2
- Issue when using Helium with Tkinter HOT 1
- Selenium runs indefinitely when adding add_experimental_option('debuggerAddress',address)
- webdriver manager HOT 2
- [ERROR] Unable to find a ChromeDriver version for the installed Chrome version HOT 1
- Recent Selenium Version
- Docs are broken HOT 3
- The chromedriver version cannot be discovered HOT 1
- Documentation missing on ReadTheDocs HOT 1
- Support renamed Chrome.app on macOS
- How to add Custom Headers to helium ? HOT 2
- Is it possible to use Helium with Safari HOT 1
- Chrome or Firefox Driver HOT 3
- Limit `find_all`'s scope to children of an Element?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helium.