selenium-firefoxdriver

Java selenium getPageSource not working

不问归期 提交于 2021-01-28 19:39:16
问题 I need the source of the url given in the program. But the program returns oly some json data not the entire page source. What's the problem?? public class selenium { public static void main(String[] args) { selenium.loadPage("http://photos.filmibeat.com/celebs/kajal-aggarwal/photos-c14-e13421-p592995.html"); } public static void loadPage(String url) { WebDriver driver = new FirefoxDriver(); driver.get(url); String html = driver.getPageSource(); System.out.println(html); driver.quit(); } }

Selenium Chrome & Firefox WebDriver: Set HTTPS proxy in Python

↘锁芯ラ 提交于 2021-01-27 18:06:01
问题 I've done plenty of searching however there is a lot of confusing snippets out there that are very similar. I've attempted to use the DesiredCapabilities , ChromeOptions , Options and a series of arguments but nothing is working :( It fails to set a proxy. For example ( ChromeOptions ) chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--proxy=https://' + proxy_ip_and_port) chrome_options.add_argument('--proxy-auth=' + proxy_user_and_pass) chrome_options.add_argument('-

selenium.common.exceptions.NoSuchElementException: Message: Web element reference not seen before using GeckoDriver Firefox and Selenium with Python

我怕爱的太早我们不能终老 提交于 2021-01-27 14:09:49
问题 I'm trying to get the data for several different tests from a test prep site. There are different subjects, each of which has a specialization, each of which has a practice-test, each of which has several questions. subject <--- specialization <---- practice-test *------ question Here's my code: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC

Not able to get console logs on firefox webdriver

南笙酒味 提交于 2021-01-19 06:45:09
问题 I am using Firefox version 53. Geckodriver version 0.16, selenium version 3.4. I want totake console logs of webdriver from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities d = DesiredCapabilities.FIREFOX d['loggingPrefs'] = {'browser': 'ALL'} driver = webdriver.Firefox(capabilities=d) driver.set_window_size(1280,1024) driver.get('http://google.com') try: for entry in driver.get_log('browser'): print entry finally: driver.quit() Console

How to set selenium webdriver from headless mode to normal mode within the same session?

大城市里の小女人 提交于 2020-12-26 11:16:55
问题 Is it possible after setting selenium webdriver to a headless mode set it back to a normal mode? from selenium import webdriver from selenium.webdriver.firefox.options import Options options = Options() options.headless = True driver = webdriver.Firefox(options=options) driver.get(http://stackoverflow.com) # set driver back to normal mode 回答1: No , it won't be possible to make Chrome operate initially in headless mode and then switch back to normal mode within the same session. When you

“Component not initialized” nsresult: “0xc1f30001 (NS_ERROR_NOT_INITIALIZED)” error with Selenium GeckoDriver and Mozilla

一曲冷凌霜 提交于 2020-08-09 08:00:51
问题 I am trying to execute my code in Firefox, sometimes it works but majority of time i get exception as: [Exception... "Component not initialized" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: chrome://marionette/content/dom.js :: addEventListener :: line 67" data: no] Its happening from last week, previously it was working fine for me. 回答1: NS_ERROR_NOT_INITIALIZED resembles an attempt which was made to use a component or object which has not yet been initialized.

How can I use setExperimentalOption through Options using FirefoxDriver in Selenium IDE?

自作多情 提交于 2020-08-08 06:06:52
问题 ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("useAutomationExtension", false); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")); I want to log in to Google using Selenium IDE but Google doesn't allow automation frameworks to log in. However, by using the above options it is possible to log in to Google. The above options are defined for ChromeDriver and I need to define them for FirefoxDriver . How can I do that?