webdriver

Exception has occurred: TypeError 'WebElement' object is not subscriptable

ぐ巨炮叔叔 提交于 2021-02-15 07:35:17
问题 Hello guys I'm really a newbie to python and I just writing a piece of code that opens Whatsapp and you give it the person's name and the message then sends how many times you want. But when I start debugging the code it gives me this: Exception has occurred: TypeError 'WebElement' object is not subscriptable File "E:\Iliya\My Courses\Python\Projects\Whatsapp Robot\Whatsapp_Bot.py", line 15, in <module> msg = driver.find_element_by_class_name('_3FRCZ')[1] # ===================================

Exception has occurred: TypeError 'WebElement' object is not subscriptable

隐身守侯 提交于 2021-02-15 07:34:46
问题 Hello guys I'm really a newbie to python and I just writing a piece of code that opens Whatsapp and you give it the person's name and the message then sends how many times you want. But when I start debugging the code it gives me this: Exception has occurred: TypeError 'WebElement' object is not subscriptable File "E:\Iliya\My Courses\Python\Projects\Whatsapp Robot\Whatsapp_Bot.py", line 15, in <module> msg = driver.find_element_by_class_name('_3FRCZ')[1] # ===================================

How to handle 'Log in with Google' popup window using Selenium WebDriver

梦想的初衷 提交于 2021-02-15 07:29:52
问题 So i have a piece of code which works on fblogin pop-up window but the same piece of code doesn't work on googlelogin popup window. I dont know why. Website = https://accounts.trivago.com/login# Fb Sign Up code : driver.findElement(By.xpath(".//*[@id='authentication-login']/div/section[1]/div[3]/div/button[1]")).click(); String parentWindow = driver.getWindowHandle(); System.out.println("Parent Window ID is : " + parentWindow); Set<String> allWindow = driver.getWindowHandles(); int count =

open url's having “# ” in them (Selenium webdriver)

有些话、适合烂在心里 提交于 2021-02-11 13:37:01
问题 I have a URL like https://abc.xyz.net/#/abcdef/1-2-3. String url = "https://abc.xyz.net/#/abcdef/1-2-3" When trying to open it using driver.get(url) , its opening only till "https://abc.xyz.net/#/" and the remaining part is not evaluated or getting truncated. Can someone please help me how to resolve it. I am using Java + Selenium WebDriver. 回答1: thanks Prany for your time. The issue is due to the fragment identifier "#" in the url. I am able to resolve it by using JavascriptExecutor. 来源:

WebDriverException Error when using selenium chrome webdriver with options

那年仲夏 提交于 2021-02-11 13:27:37
问题 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

WebDriverException Error when using selenium chrome webdriver with options

送分小仙女□ 提交于 2021-02-11 13:27:26
问题 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

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

How to scrape a website thet has username and password?

你说的曾经没有我的故事 提交于 2021-02-11 12:49:43
问题 I am trying to scrape a website and make my program know all the buttons and links that inside of that website but my problem is that to get to the first page I need to enter a username and a password and then scraping the page that shows after that and every time it's scraping to the page with the password and the username someone knows how to do that? because I don't know-how this is the code that I tried: import requests import time from bs4 import BeautifulSoup from selenium import

How to open MS Edge with specific profile with selenium webDriver?

最后都变了- 提交于 2021-02-11 12:32:23
问题 I am running automation on the edge browser. Edge browser supports profile and whenever i launch the edge from webdriver, it create new profile. Is there any way I can set the option to launch edge with given user profile ? 回答1: I use Java language as an example. You could use user-data-dir and profile-directory to use specific profile to launch Edge with Selenium. The sample code is like below: System.setProperty("webdriver.edge.driver", "your\\path\\to\\edge\\webdriver\\msedgedriver.exe");

How to selecting option from right click menu with Selenium

橙三吉。 提交于 2021-02-11 11:53:27
问题 I'm using chrome as the driver and after double-clicking/context-clicking, the prompt window opens but the driver won't switch to the prompt window. Here is what I have tried... The page I am opening is google.com, search, then trying to right-click so i can open the results in different tabs. Thanks in advance. ....... element = driver.find_element_by_class_name("LC20lb") actionchains = ActionChains(driver) actionchains.context_click(element).perform() # Driver needs to switch to the popup