![]() ![]() ※ result of line.10 is content of blue rectangle in the picture below Print(name.text)# print text in li of ol.nameList of div id: result # result will be the string in the blue part of picture showed below NameList = browser.find_elements_by_css_selector('div.results ol.nameList li') # get the content which are in li of ol.nameList of div id: result open webbrowser => go to the website via URL => get content in li of ol id: nameList of div id: results => print content in in li of ol id: nameList of div id: results => close ![]() ※ result of line.9 is content of blue rectangle in the picture belowģ. Print(lipsum.text) # print text in div id: lipsum # result will be the string in the blue part of picture showed below Lipsum = browser.find_element_by_id('lipsum') # get the content which is in div id: lipsum ![]() open webbrowser => go to the website via URL => get content in div id: lipsum => print content in div id: lipsum => closeįrom import Options # ?įrom import Keys # ?įirefoxOptions.add_argument("-headless") # ? Print('Title: %s' % browser.title) # output: Linux HintĢ. open webbrowser => go to the website via URL => get title? => close browserīrowser = webdriver.Firefox() # open browser We need to download web browser driver for web browser # download geckodriver and copy to /usr/bin Virtualenv -p python3 selenium_virtualenv # environment installing / setting method (virtualenv is optional) Web browser driver: 0.29.1 (geckodr4iver) (for firefox) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |