selenium

WebDriverException Error when using selenium chrome webdriver with options

别来无恙 提交于 2021-02-11 13:27:20
问题 I would like to run the chrome webdriver on my MAC with my original chrome profile/options, so that i don't need to write a script to log in to the page in the temporary opened automated driver. my original code without options was run successfully DRIVER = 'chromedriver' driver = webdriver.Chrome(DRIVER) However, when I try to use options I get the following error, and here is my code from selenium import webdriver from selenium.webdriver.chrome.options import Options options = webdriver

Selenium WebDriver: Handling DropDowns [duplicate]

℡╲_俬逩灬. 提交于 2021-02-11 13:14:48
问题 This question already has answers here : How to select/get drop down option in Selenium 2 (8 answers) Closed 4 years ago . I want to get values(String) listed in a dropdown, and compare those values with a predefined list of values(String). I'm trying to implement this in Selenium WebDriver using JAVA as scripting language. Can anyone please guide me through? Situation: Suppose in a webpage there is a dropdown listing country names, I want to read those country names from dropdown, and verify

How can I find multiple usernames that have the same class name in Python with Selenium?

谁说我不能喝 提交于 2021-02-11 13:11:39
问题 if type == 2: for p in range(1, maxpages + 1): link = url + str(p) driver.get(link) Users = driver.find_elements_by_class_name("link span h5 hv7 secondary") print(Users[0].text) print(Users[1].text) print(Users[2].text) I hope you can understand what I'm trying to do with the code above. I'm trying to find ALL elements that have the class name: link span h5 hv7 secondary (there are over 100) And then print them out each individually. error for Nic's reply: User: <selenium.webdriver.remote

selenium.common.exceptions.TimeoutException while clicking on a button using expected_conditions presence_of_element_located in Selenium Python

℡╲_俬逩灬. 提交于 2021-02-11 13:09:20
问题 I want to create an automatic creation for Nike accounts. For that I need to add a phone number. I am coding with Python 3, Selenium and the Chrome Webdriver. This is my current code: driver.get('https://www.nike.com/de/member/settings') element2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[3]/div/div[6]/div[2]/div[2]/div/form/div[2]/div[5]/div/div/div/div[2]/button"))) driver.execute_script("arguments[0].click();", element2) time.sleep(1) This

How can I find multiple usernames that have the same class name in Python with Selenium?

那年仲夏 提交于 2021-02-11 13:04:36
问题 if type == 2: for p in range(1, maxpages + 1): link = url + str(p) driver.get(link) Users = driver.find_elements_by_class_name("link span h5 hv7 secondary") print(Users[0].text) print(Users[1].text) print(Users[2].text) I hope you can understand what I'm trying to do with the code above. I'm trying to find ALL elements that have the class name: link span h5 hv7 secondary (there are over 100) And then print them out each individually. error for Nic's reply: User: <selenium.webdriver.remote

Unable to login with python selenium error:NoSuchElementException error

这一生的挚爱 提交于 2021-02-11 13:02:48
问题 I have tried locating the submit button by id and xpath but none of them worked and checked in the page source ,the id is same.I have no idea why this is happening even though I am giving the correct Id or xpath URL : https://moodle.niituniversity.in/moodle/login/index.php from pyvirtualdisplay import Display from selenium import webdriver from selenium.webdriver.common.keys import Keys display = Display(visible=0, size=(1024, 768)) display.start() driver = webdriver.Firefox() #driver.set

Click “Download csv” button using Selenium and Beautiful Soup

为君一笑 提交于 2021-02-11 12:57:58
问题 I'm trying to download the csv file from this website: https://invasions.si.edu/nbicdb/arrivals?state=AL&submit=Search+database&begin=2000-01-01&end=2020-11-11&type=General+Cargo&bwms=any To do so, I need to click the CSV button, which downloads the CSV file. However, I need to do this for multiple links, which is why I want to use Selenium to automate the task of clicking on the link. The code I have currently runs, but it does not actually download the csv file to the designated folder (or

Click “Download csv” button using Selenium and Beautiful Soup

橙三吉。 提交于 2021-02-11 12:57:00
问题 I'm trying to download the csv file from this website: https://invasions.si.edu/nbicdb/arrivals?state=AL&submit=Search+database&begin=2000-01-01&end=2020-11-11&type=General+Cargo&bwms=any To do so, I need to click the CSV button, which downloads the CSV file. However, I need to do this for multiple links, which is why I want to use Selenium to automate the task of clicking on the link. The code I have currently runs, but it does not actually download the csv file to the designated folder (or

.send_keys in selenium is messing up indentation when using with pyperclip

三世轮回 提交于 2021-02-11 12:56:55
问题 I'm copying some code from Leetcode to paste in Github, I use pyperclip to paste and copy into clipboard using Selenium. Everything is saved as a string but when i use driver.send_keys(pyperclip.paste()) this is what happens I've verified that the issue is not Leetcode or Github by copying from Leetcode on my own and then pasting it to Github. The issue is pyperclip because when I paste this is the format However the issue clearly gets amplified when I use driver.send_keys() because as you

Entering python code in textarea using sendkey, but not working. Any solution?(selenium Java)

删除回忆录丶 提交于 2021-02-11 12:55:24
问题 I set string in which i stored the python code and pass this string to using sendkey. But the code got unstructured and extra spaces and words got entered in the code. Below is the code : //Defining the string String code = "# Python program to display the Fibonacci sequence\n" + "\n" + "def recur_fibo(n):\n" + " if n <= 1:\n" + " return n\n" + " else:\n" + " return(recur_fibo(n-1) + recur_fibo(n-2))\n" + "\n" + "nterms = 10\n" + "\n" + "# check if the number of terms is valid\n" + "if nterms