selenium-chromedriver

Python Selenium Printing Save-As-PDF Waiting for Filename Input

元气小坏坏 提交于 2021-02-10 06:32:08
问题 I'm trying to save a website as PDF through printing dialog. My code allows me to save as pdf, but asks me to input a filename, which I don't know how to pass a filename to the pop up box. Attached is my code: import time from selenium import webdriver import os class printing_browser(object): def __init__(self): self.profile = webdriver.FirefoxProfile() self.profile.set_preference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", False) self.profile.set_preference("pdfjs

Cloudflare and Chromedriver - cloudflare distinguishes between chromedriver and genuine chrome?

别来无恙 提交于 2021-02-10 04:28:08
问题 I would like to use chromedriver to scrape some stories from fanfiction.net. I try the following: from selenium import webdriver import time path = 'D:\chromedriver\chromedriver.exe' browser = webdriver.Chrome(path) url1 = 'https://www.fanfiction.net/s/8832472' url2 = 'https://www.fanfiction.net/s/5218118' browser.get(url1) time.sleep(5) browser.get(url2) The first link opens (sometimes I have to wait 5 seconds). When I want to load the second url, cloudflare intervens and wants me to solve

Codeception - Can't connect to Webdriver (Acceptance Test)

半腔热情 提交于 2021-02-09 09:20:44
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Codeception - Can't connect to Webdriver (Acceptance Test)

江枫思渺然 提交于 2021-02-09 09:20:20
问题 I can access url and create sessions: http://localhost:4444/wd/hub/static/resource/hub.html but when i execute ./codecept run i get an error, but i have Selenium Server running: [ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running. To execute Selenium Server, i used this command: java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar" I tried too with IE and Chrome (i

Testing with watir chromedriver failed with Sec-Fetch-User in Request Headers

依然范特西╮ 提交于 2021-02-08 09:17:17
问题 I am using watir for testing an internal application. The testing recently stops working. These are the simplified steps of the test: require 'watir' Selenium::WebDriver::Chrome.path = 'PATH_TO_CHROME_EXE' browser = Watir::Browser.new :chrome, :options => {:options => {'useAutomationExtension' => false}} URL = "TEST_URL" browser.goto URL After the goto line executed, the browser failed to navigate to the page. When inspecting the network activity, The request status showing as canceled. I

Testing with watir chromedriver failed with Sec-Fetch-User in Request Headers

可紊 提交于 2021-02-08 09:13:58
问题 I am using watir for testing an internal application. The testing recently stops working. These are the simplified steps of the test: require 'watir' Selenium::WebDriver::Chrome.path = 'PATH_TO_CHROME_EXE' browser = Watir::Browser.new :chrome, :options => {:options => {'useAutomationExtension' => false}} URL = "TEST_URL" browser.goto URL After the goto line executed, the browser failed to navigate to the page. When inspecting the network activity, The request status showing as canceled. I

Automating Selenium Headless mode errors

白昼怎懂夜的黑 提交于 2021-02-08 09:12:41
问题 I tried automating the below code with headful mode and it works but not in headless mode. Throws a lot of javascript errors and finally says unable to find the element. chrome_options = Options() chrome_options.headless = True chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']) chrome_options.add_argument( "user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36") chrome_options.add_argument("-

Automating Selenium Headless mode errors

℡╲_俬逩灬. 提交于 2021-02-08 09:06:59
问题 I tried automating the below code with headful mode and it works but not in headless mode. Throws a lot of javascript errors and finally says unable to find the element. chrome_options = Options() chrome_options.headless = True chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']) chrome_options.add_argument( "user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36") chrome_options.add_argument("-

Automating Selenium Headless mode errors

穿精又带淫゛_ 提交于 2021-02-08 09:06:49
问题 I tried automating the below code with headful mode and it works but not in headless mode. Throws a lot of javascript errors and finally says unable to find the element. chrome_options = Options() chrome_options.headless = True chrome_options.add_experimental_option("excludeSwitches", ['enable-automation']) chrome_options.add_argument( "user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36") chrome_options.add_argument("-

How can I add an extension to my chromedriver at the Robot Framework with Selenium2Library and launch remotely

醉酒当歌 提交于 2021-02-08 08:26:48
问题 I got stuck with scenario like How can I add an extension to my chromedriver at the Robot level with Selenium2Library , but i am trying to launch browser on a remote machine. Answer present on the above question works well on local machine. But to how to add an extension to chrome browser and launch on remote machine. Using python to get chrome options def launchbrowserwithextension(): options = webdriver.ChromeOptions() options.add_argument('--load-and-launch-app=path_to_extension') return