selenium-webdriver

Using permanent profiles and cookies in Selenium

纵饮孤独 提交于 2021-01-07 03:08:22
问题 I have a Django website and I'm using Selenium. I want to have one or two permanent profiles with Chrome or Firefox, to check that users remain logged in for example after I upgrade Django and then users login from another profile/session (the default is not to remain logged in, but I patched Django to remain logged in). For this I need permanent profiles and cookies. I want to login once, and then check that I'm still logged in the next time I run Selenium tests. I searched and found out

Using permanent profiles and cookies in Selenium

我只是一个虾纸丫 提交于 2021-01-07 03:07:32
问题 I have a Django website and I'm using Selenium. I want to have one or two permanent profiles with Chrome or Firefox, to check that users remain logged in for example after I upgrade Django and then users login from another profile/session (the default is not to remain logged in, but I patched Django to remain logged in). For this I need permanent profiles and cookies. I want to login once, and then check that I'm still logged in the next time I run Selenium tests. I searched and found out

How to locate web elements with similar attributes [duplicate]

馋奶兔 提交于 2021-01-06 00:07:13
问题 This question already has answers here : Can selenium recognize aria-uuid as an ID for object recognition? (2 answers) Vba - webscraping using ng-click (4 answers) Find an element where data-tb-test-id attribute is present instead of id using Selenium and Python (3 answers) Closed 2 days ago . I am performing automation on a web page, the problem is i cannot locate a web element because it has identical attributes to that of other 20 web elements with similar parents and children, with one

How to locate web elements with similar attributes [duplicate]

烈酒焚心 提交于 2021-01-05 23:56:58
问题 This question already has answers here : Can selenium recognize aria-uuid as an ID for object recognition? (2 answers) Vba - webscraping using ng-click (4 answers) Find an element where data-tb-test-id attribute is present instead of id using Selenium and Python (3 answers) Closed 2 days ago . I am performing automation on a web page, the problem is i cannot locate a web element because it has identical attributes to that of other 20 web elements with similar parents and children, with one

TypeError: 'str' object is not callable using Selenium through Python

守給你的承諾、 提交于 2021-01-05 06:46:10
问题 When I try to do code shown below I get error : TypeError: 'str' object is not callable email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").text() 回答1: This error message... TypeError: 'str' object is not callable ...implies that your program have invoked a function() which is actually a property . As per selenium.webdriver.remote.webelement text is a property . So, you can't invoke text() as a function. Hence you see the error.

TypeError: 'str' object is not callable using Selenium through Python

耗尽温柔 提交于 2021-01-05 06:45:15
问题 When I try to do code shown below I get error : TypeError: 'str' object is not callable email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").text() 回答1: This error message... TypeError: 'str' object is not callable ...implies that your program have invoked a function() which is actually a property . As per selenium.webdriver.remote.webelement text is a property . So, you can't invoke text() as a function. Hence you see the error.

TypeError: 'str' object is not callable using Selenium through Python

倾然丶 夕夏残阳落幕 提交于 2021-01-05 06:42:21
问题 When I try to do code shown below I get error : TypeError: 'str' object is not callable email2_elem = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]").text() 回答1: This error message... TypeError: 'str' object is not callable ...implies that your program have invoked a function() which is actually a property . As per selenium.webdriver.remote.webelement text is a property . So, you can't invoke text() as a function. Hence you see the error.

Opening ChromeDriver in fullscreen, selenium and python

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-04 14:56:11
问题 I'm attempting to open my ChromeDriver in full screen. I've tried everything possible and can't seem to find a solution for it. After searching throughout google and stackoverflow it seems many people have had the same issue, this is for mac os x. I thought that doing the (command, shift, f) would work but it doesn't. Does anyone have a solution? from selenium import webdriver from selenium.webdriver.common.keys import Keys import time urls = [x,y,z] driver = webdriver.Chrome() #Would like

Using python selenium for Microsoft edge

旧城冷巷雨未停 提交于 2021-01-04 07:30:43
问题 I am trying to use pythons selenium for Microsoft edge but I keep getting this error: WebDriverException: Message: unknown error: cannot find Microsoft Edge binary I downloaded the latest version of the edge driver. Here is my code: from selenium import webdriver from selenium.webdriver.remote import webelement from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support

What is the difference in “find_element_by_xpath” and “driver.find_elements(By.XPATH)”

痞子三分冷 提交于 2021-01-03 06:27:06
问题 I have been using selenium for a while with these two methods interchangeably. elem = driver.find_element_by_xpath("some_xpath") elem = driver.find_element(By.XPATH,"some_xpath") So far both of them work. I wanted to understand what is the difference in both of them. https://selenium-python.readthedocs.io/locating-elements.html Documentation mentions By.XPATH as private method, but did not understand it clearly. 回答1: find_element_by_xpath('xpath') calls find_element(By.XPATH,'xpath') , so