selenium-webdriver

ERR_BLOCKED_BY_XSS_AUDITOR when downloading file using selenium

痞子三分冷 提交于 2020-06-28 05:05:08
问题 I'm trying to download a file using selenium by simulating click on a download button but Chrome reports ERR_BLOCKED_BY_XSS_AUDITOR . If I use the "--disable-xss-auditor" argument to bypass, the page would be reloaded and nothing get downloaded. What seems strange to me is that when I actually download the file with my mouse in a Chrome session that's even controlled by selenium , the file downloads well. Please help me understand what xss auditor does? Why can't I download the file with

ERR_BLOCKED_BY_XSS_AUDITOR when downloading file using selenium

随声附和 提交于 2020-06-28 05:05:06
问题 I'm trying to download a file using selenium by simulating click on a download button but Chrome reports ERR_BLOCKED_BY_XSS_AUDITOR . If I use the "--disable-xss-auditor" argument to bypass, the page would be reloaded and nothing get downloaded. What seems strange to me is that when I actually download the file with my mouse in a Chrome session that's even controlled by selenium , the file downloads well. Please help me understand what xss auditor does? Why can't I download the file with

unable to run selenium chrome-driver on google-cloud-run

给你一囗甜甜゛ 提交于 2020-06-28 04:47:24
问题 I have a docker container that runs a working selenium chrome driver script, however when the same image is deployed to Google Cloud Run I encounter the following error. webdriver.Chrome('/home/vmagent/app/chromedriver', chrome_options=self.options) File "/env/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__

unable to run selenium chrome-driver on google-cloud-run

百般思念 提交于 2020-06-28 04:47:08
问题 I have a docker container that runs a working selenium chrome driver script, however when the same image is deployed to Google Cloud Run I encounter the following error. webdriver.Chrome('/home/vmagent/app/chromedriver', chrome_options=self.options) File "/env/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__

WebDriverWait for multiple conditions (OR logical evaluation)

故事扮演 提交于 2020-06-28 04:12:28
问题 Using python, the method WebDriverWait is used to wait for 1 element to be present on the webpage. How can this method be used without multiple try/except? Is there an OR option for multiple cases using this method? https://selenium-python.readthedocs.io/waits.html 回答1: Without using multiple try/except{} to induce WebDriverWait for two elements through OR option you can use either of the following solutions: Using CSS_SELECTOR : element = WebDriverWait(driver, 10).until( EC.presence_of

Inducing WebDriverWait for specific elements

南笙酒味 提交于 2020-06-28 04:04:26
问题 This question is a follow up to my previous question (Inconsistency in scraping through <div>'s in Selenium). I'm working on scraping all of the Air Jordan Data off of grailed.com (https://www.grailed.com/designers/jordan-brand/hi-top-sneakers). I am storing the size, model, url, and image url in an object. I currently have a program that scrolls through the entire feed and fetches all of this. Everything works except finding the image url. The image URL seems to require inducing an explicit

VBA to find if an element contains certain texts

▼魔方 西西 提交于 2020-06-28 03:37:14
问题 I'm new to Selenium and VBA. What i want to do is automate selection of a certain TEXT in a CSS. Selenium brings me this: css=.x-grid3-row:nth-child(42) .x-grid3-col:nth-child(4) > .x-grid3-cell-inner Everyting would be fine, except the TEXT I want to select sometimes move to different grid3-row:nth-child What I want to achieve is to find in which x-grid3-row:nth-child the desired TEXT is so I could click it with a VBA bot. Thank you for your help. 回答1: You won't be able to construct a css

How to send simultaneous keys in RSelenium ALT+S to web driver?

廉价感情. 提交于 2020-06-27 15:23:08
问题 I would like to send two simultaneous keys such as ALT+S to the sendKeysToActiveElement( function of the R Selenium webdriver. I only see implementations in Java and C. Can this be done? 回答1: Use below code :- String selectAll = Keys.chord(Keys.ALT, "s"); driver.findElement(By.xpath("YOURLOCATOR")).sendKeys(selectAll); Hope it will help you :) 回答2: If you want to send a single keystroke then use: cl$sendKeysToActiveElement(sendKeys = list(key = "tab")) If you press more than two keystrokes

How to send simultaneous keys in RSelenium ALT+S to web driver?

折月煮酒 提交于 2020-06-27 15:22:16
问题 I would like to send two simultaneous keys such as ALT+S to the sendKeysToActiveElement( function of the R Selenium webdriver. I only see implementations in Java and C. Can this be done? 回答1: Use below code :- String selectAll = Keys.chord(Keys.ALT, "s"); driver.findElement(By.xpath("YOURLOCATOR")).sendKeys(selectAll); Hope it will help you :) 回答2: If you want to send a single keystroke then use: cl$sendKeysToActiveElement(sendKeys = list(key = "tab")) If you press more than two keystrokes

How to send text to the search field through Selenium and Python

北慕城南 提交于 2020-06-27 12:06:47
问题 I am trying to pass arguments to a search text in a HTML code using Selenium in Python: I am working on the following HTML code: </form><form class="search-box-inner"> <div class="input-container"> <input type="text" class="typeahead search-box-input left" autocomplete="off" placeholder="Search ratings, research, analysts, and more..." maxlength="900"></div> </form> The code does not have id or name. It has elements by class only. I tried the following self.driver.find_elements_by_class_name(