Package: get-pybrowser
pybrowserFor documentation, referhereHere is a quick example,frompybrowserimportBrowserwithBrowser(browser_name=Browser.CHROME)asb:b.goto("https://www.google.com/")b.input("name:=q").enter("news")b.button("name:=btnK").click()screenshot_path=b.take_screenshot()print(b.html().elements.links())Release Notes:0.2.0ChangesChanges in underlyingBrowser.requests_sessionobject,requests_session.resulthas been removed. There is justrequests_session.responsewhich is a blocking call (in caseasynchflag is set). Also note,requests_session.is_request_doneis still available to see if request is complete of not. There are no changes to other properties and are blocking in case of asynchronous call.requests_session.content()method with options for bytes and text has been changed to properties, just like in underlying requests. That is now you call,requests_session.contentfor bytes andrequests_session.textfor text.In context of above changes,Browserobject also has below changes,Browser.getandBrowser.postnow returnsrequests_sessionobject (used to berequests_session.response).Browser.content()has been changed to properties. That is now you call,Browser.contentfor bytes andBrowser.textfor text.New featuresSupport for remote url. Please note this requiresSelenium Gridto be setup explicitly. Once done use the URL here.Flags for Opera browser (Browser.OPERA). Webdriver executable needs to be present indriver_path.
Please noteEDGEandSAFARIare also supported the same way. That is, webdriver isn't automatically downloaded, instead path needs to be provided.0.1.0ChangesPlease note some key changes with regards to properties changing to methods.Methods which were properties in initial release are now method calls. Below is the impacted list.In Browser,Browser.refresh()Browser.back()Browser.forward()Browser.maximize_window()Browser.minimize_window()Browser.fullscreen_window()Browser.delete_all_cookies()Browser.close()In Action (used by all elements),Action.refresh()Action.highlight()Action.double_click()Action.move_to_element()Specific elements also,Checkbox.check()Checkbox.uncheck()Radio.select()Radio.unselect()Input.clear()Browser class__init__method now has more options,firefox_binary_pathfirefox_profile_pathhttp_proxydriver_pathSelect element has below method changes,Select.options(get="text")method has been split to multiple properties to keep it simple,Select.options_textSelect.options_valueSelect.options_elementSimilar change has been done forSelect.all_selected_options(get="text"),Select.all_selected_options_textSelect.all_selected_options_valueSelect.all_selected_options_elementFile element changes,Below enhancements have been made to download feature,Added more parameters -unzip- Set this flag to unzip file. Default isFalsedel_zipfile- Set this flag to delete zip file after it has been unzipped. Default isFalseadd_to_ospath- Set this flag to add directory toPATH. Default isFalseNew properties -As you might already know, download happens in background (asynchronous) by default and can of course be changed withasynch. To check if download was successful, below properties are available,is_download_complete-TrueorFalsedownloaded_files- list of downloaded filesHTML links method has below method changes,This is the one you would invoke via Browser asBrowser.html().elements.link().Added more parameters -images- You can filter out images. Default isFalsethat means to includeimages, you will need to set this toTruename_length_limit- This limits the length of name of the url. Default is 60Change in return type. Before this change, return type was a list of types (name, url). This has been changed to list ofnamed_tuplesof form('Link', ['name', 'url'])Changes in some env options.Removed below options as they don't have sense. Either you provide complete driver download url or provide version
so that the API tries to download,CHROME_FILENAMEIE_FILENAMECHROMEDRIVER_DEFAULT_VERSIONAdded below for Firefox support,FIREFOX_HOME_URLFIREFOX_DOWNLOAD_URLFIREFOXDRIVER_VERSIONRefactoring (non functional) in code and tests. Lot more testing needed still :-\New featuresSupport for Firefox !0.0.1Very first release !