selenium-webdriver

Out of memory Error in Python+Selenium first load

强颜欢笑 提交于 2020-12-31 16:07:53
问题 I'm trying, and failing, to open the website https://www.bet365.com with selenium and python. In my code, I've followed these steps. First, I just did from selenium import webdriver browser=webdriver.Chrome() browser.get('https://www.bet365.com') After a while, Bet365 changed something and doing the above returned a gray screen. In order to bypass that, I did the following from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument("window-size=1920,1080") options

Why is getText() in Selenium not working for <textarea> elements, but getAttribute(“value”) is?

那年仲夏 提交于 2020-12-31 04:59:49
问题 Given you have some HTML with a textarea element and want to get its text via Selenium (here Java-binding). <textarea name="txtComment" id="txtComment" rows="2" cols="20"> Some comment inside the textarea </textarea> This is how I see the code via developer tools (Internet Explorer and Firefox), so it seems like it is a normal text-node and not inside the "value" attribute of the element. Why is it then that getText() does not work : driver.findElement(By.id("txtComment")).getText(); It only

Why is getText() in Selenium not working for <textarea> elements, but getAttribute(“value”) is?

左心房为你撑大大i 提交于 2020-12-31 04:56:36
问题 Given you have some HTML with a textarea element and want to get its text via Selenium (here Java-binding). <textarea name="txtComment" id="txtComment" rows="2" cols="20"> Some comment inside the textarea </textarea> This is how I see the code via developer tools (Internet Explorer and Firefox), so it seems like it is a normal text-node and not inside the "value" attribute of the element. Why is it then that getText() does not work : driver.findElement(By.id("txtComment")).getText(); It only

Why is getText() in Selenium not working for <textarea> elements, but getAttribute(“value”) is?

本小妞迷上赌 提交于 2020-12-31 04:56:05
问题 Given you have some HTML with a textarea element and want to get its text via Selenium (here Java-binding). <textarea name="txtComment" id="txtComment" rows="2" cols="20"> Some comment inside the textarea </textarea> This is how I see the code via developer tools (Internet Explorer and Firefox), so it seems like it is a normal text-node and not inside the "value" attribute of the element. Why is it then that getText() does not work : driver.findElement(By.id("txtComment")).getText(); It only

Why is getText() in Selenium not working for <textarea> elements, but getAttribute(“value”) is?

白昼怎懂夜的黑 提交于 2020-12-31 04:55:03
问题 Given you have some HTML with a textarea element and want to get its text via Selenium (here Java-binding). <textarea name="txtComment" id="txtComment" rows="2" cols="20"> Some comment inside the textarea </textarea> This is how I see the code via developer tools (Internet Explorer and Firefox), so it seems like it is a normal text-node and not inside the "value" attribute of the element. Why is it then that getText() does not work : driver.findElement(By.id("txtComment")).getText(); It only

How can I add Selenium to Excel VBA 2013?

北城余情 提交于 2020-12-30 03:18:45
问题 I'd like to develop an Excel VBA project that interacts with the browser. I hear Selenium is a great tool for this but Excel 2013 where I work doesn't seem to have it listed as an object library under Tools > References... in the VBA editor. Is there a site where I can download Selenium for Excel VBA and import it via the Browse button, or am I doomed to abandon this project? Having looked online, I can find selenium downloads for several programming languages, but not VBA. Alternately, is

How can I add Selenium to Excel VBA 2013?

限于喜欢 提交于 2020-12-30 03:16:06
问题 I'd like to develop an Excel VBA project that interacts with the browser. I hear Selenium is a great tool for this but Excel 2013 where I work doesn't seem to have it listed as an object library under Tools > References... in the VBA editor. Is there a site where I can download Selenium for Excel VBA and import it via the Browse button, or am I doomed to abandon this project? Having looked online, I can find selenium downloads for several programming languages, but not VBA. Alternately, is

Handling “Accept Cookies” popup with Selenium in Python

早过忘川 提交于 2020-12-29 12:28:28
问题 I've been trying to scrape some information of this real estate website with selenium. However when I access the website I need to accept cookies to continue. This only happens when the bot accesses the website, not when I do it manually. When I try to find the corresponding element either by xpath or id, as I find it when I inspect the page manually I get following error. selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath",

How to get findElementById method?

大憨熊 提交于 2020-12-27 07:29:41
问题 I loaded Selenium latest version 3.3.1 to my system through maven dependencies. While trying to code, I couldn't get the method findElementById() . Instead, I am getting only old method findElement() . Can anyone help me? Note: In maven, it shows only latest version. 回答1: add following dependency to maven, do maven clean and maven build Use RemoteWebDriver type while instantiating driver like "RemoteWebDriver driver=new FirefoxDriver()" as RemoteWebDriver class has findElementById() method <

Change default download location on Edge chromium

无人久伴 提交于 2020-12-26 12:13:03
问题 I would like to ask if someone has tried to change the default download location on Microsoft Edge Chromium driver using selenium 3.X. On Chrome browser, we could use something like this HashMap<String, Object> chromePrefs = new HashMap<String, Object>(); chromePrefs.put("download.default_directory", savePAth); chromePrefs.put("prompt_for_download", false); options.setExperimentalOption("prefs", chromePrefs); Info: Microsoft Edge Browser version: 80.0.361.66 (Official build) (64-bit) Thanks