Chromedriver finding an xpath just fine with a head, but not when headless [duplicate]Gmail login using selenium webdriver in javaLog into gmail using Selenium in PythonJUnit (Selenium WebDriver) to open www.google.co.uk in Chrome Browserwhy 2nd click action is not run when browser is Google ChromeHow to open chrome developer console using Selenium in Python?Executable needs to be in PATH - Running Selenium on GNURoot on AndroidBrowserMob Proxy Python - How to get response body?Chrome closing after some time and produce error selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service in pythonSET ERROR IGNORE Python selenium--headless is not an option in chrome webdriver for selenium python

Was the Boeing 2707 design flawed?

Architectural feasibility of a tiered circular stone keep

Changing JPEG to RAW to use on Lightroom?

Can $! cause race conditions when used in scripts running in parallel?

HJM in infinite dimensions

Very slow boot time and poor perfomance

Can RMSE and MAE have the same value?

Evaluated vs. unevaluated Association

Command "root" and "subcommands"

Server Integrity Check CheckCommands question

Duplicate instruments in unison in an orchestra

Why is the UK so keen to remove the "backstop" when their leadership seems to think that no border will be needed in Northern Ireland?

Discussing work with supervisor in an invited dinner with his family

Higman's lemma and a manuscript of Erdős and Rado

How can I download a file through 2 SSH connections?

Cooking Scrambled Eggs

Why do proofs of Bernoulli's equation assume that forces on opposite ends point in different directions?

When, exactly, does the Rogue Scout get to use their Skirmisher ability?

Ordering a list of integers

Handling Disruptive Student on the Autism Spectrum

"There were either twelve sexes or none."

Removal of て in Japanese novels

What is a natural problem in theory of computation?

Where can/should I, as a high schooler, publish a paper regarding the derivation of a formula?



Chromedriver finding an xpath just fine with a head, but not when headless [duplicate]


Gmail login using selenium webdriver in javaLog into gmail using Selenium in PythonJUnit (Selenium WebDriver) to open www.google.co.uk in Chrome Browserwhy 2nd click action is not run when browser is Google ChromeHow to open chrome developer console using Selenium in Python?Executable needs to be in PATH - Running Selenium on GNURoot on AndroidBrowserMob Proxy Python - How to get response body?Chrome closing after some time and produce error selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service in pythonSET ERROR IGNORE Python selenium--headless is not an option in chrome webdriver for selenium python






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1
















This question already has an answer here:



  • Gmail login using selenium webdriver in java

    1 answer



  • Log into gmail using Selenium in Python

    1 answer



I built a program which has different functions that interact with some of the google services, but first of all it has to login to the specified google account. When the chrome has a head, it works fine, but when I attempted to make it headless, it couldn't find the xpath of the first element, which was the email field. The code I've got is below.



from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("--headless")
driver = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe", options=options)


And then it tries to log in with the specified credentials.



driver.get('https://accounts.google.com/signin/v2')
driver.find_element_by_xpath('//*[contains(@name,"identifier")]').send_keys('mail')
driver.find_element_by_xpath('//*[@id="identifierNext"]/content/span').click()
driver.find_element_by_xpath('//*[contains(@name,"password")]').send_keys('password')
driver.find_element_by_xpath('//*[@id="passwordNext"]/content/span').click()


While this works fine without the



 options.add_argument("--headless")


it doesnt work with it and I have no idea why. I would appreciate any help on the matter. Both chrome and chromedriver are updated to the latest version.










share|improve this question














marked as duplicate by DebanjanB selenium
Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 27 at 21:32


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

























    1
















    This question already has an answer here:



    • Gmail login using selenium webdriver in java

      1 answer



    • Log into gmail using Selenium in Python

      1 answer



    I built a program which has different functions that interact with some of the google services, but first of all it has to login to the specified google account. When the chrome has a head, it works fine, but when I attempted to make it headless, it couldn't find the xpath of the first element, which was the email field. The code I've got is below.



    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options

    options = Options()
    options.add_argument("--headless")
    driver = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe", options=options)


    And then it tries to log in with the specified credentials.



    driver.get('https://accounts.google.com/signin/v2')
    driver.find_element_by_xpath('//*[contains(@name,"identifier")]').send_keys('mail')
    driver.find_element_by_xpath('//*[@id="identifierNext"]/content/span').click()
    driver.find_element_by_xpath('//*[contains(@name,"password")]').send_keys('password')
    driver.find_element_by_xpath('//*[@id="passwordNext"]/content/span').click()


    While this works fine without the



     options.add_argument("--headless")


    it doesnt work with it and I have no idea why. I would appreciate any help on the matter. Both chrome and chromedriver are updated to the latest version.










    share|improve this question














    marked as duplicate by DebanjanB selenium
    Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Mar 27 at 21:32


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      1












      1








      1









      This question already has an answer here:



      • Gmail login using selenium webdriver in java

        1 answer



      • Log into gmail using Selenium in Python

        1 answer



      I built a program which has different functions that interact with some of the google services, but first of all it has to login to the specified google account. When the chrome has a head, it works fine, but when I attempted to make it headless, it couldn't find the xpath of the first element, which was the email field. The code I've got is below.



      from selenium import webdriver
      from selenium.webdriver.chrome.options import Options

      options = Options()
      options.add_argument("--headless")
      driver = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe", options=options)


      And then it tries to log in with the specified credentials.



      driver.get('https://accounts.google.com/signin/v2')
      driver.find_element_by_xpath('//*[contains(@name,"identifier")]').send_keys('mail')
      driver.find_element_by_xpath('//*[@id="identifierNext"]/content/span').click()
      driver.find_element_by_xpath('//*[contains(@name,"password")]').send_keys('password')
      driver.find_element_by_xpath('//*[@id="passwordNext"]/content/span').click()


      While this works fine without the



       options.add_argument("--headless")


      it doesnt work with it and I have no idea why. I would appreciate any help on the matter. Both chrome and chromedriver are updated to the latest version.










      share|improve this question















      This question already has an answer here:



      • Gmail login using selenium webdriver in java

        1 answer



      • Log into gmail using Selenium in Python

        1 answer



      I built a program which has different functions that interact with some of the google services, but first of all it has to login to the specified google account. When the chrome has a head, it works fine, but when I attempted to make it headless, it couldn't find the xpath of the first element, which was the email field. The code I've got is below.



      from selenium import webdriver
      from selenium.webdriver.chrome.options import Options

      options = Options()
      options.add_argument("--headless")
      driver = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe", options=options)


      And then it tries to log in with the specified credentials.



      driver.get('https://accounts.google.com/signin/v2')
      driver.find_element_by_xpath('//*[contains(@name,"identifier")]').send_keys('mail')
      driver.find_element_by_xpath('//*[@id="identifierNext"]/content/span').click()
      driver.find_element_by_xpath('//*[contains(@name,"password")]').send_keys('password')
      driver.find_element_by_xpath('//*[@id="passwordNext"]/content/span').click()


      While this works fine without the



       options.add_argument("--headless")


      it doesnt work with it and I have no idea why. I would appreciate any help on the matter. Both chrome and chromedriver are updated to the latest version.





      This question already has an answer here:



      • Gmail login using selenium webdriver in java

        1 answer



      • Log into gmail using Selenium in Python

        1 answer







      python selenium xpath






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 18:34









      NaayNaay

      286 bronze badges




      286 bronze badges





      marked as duplicate by DebanjanB selenium
      Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 27 at 21:32


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











      marked as duplicate by DebanjanB selenium
      Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 27 at 21:32


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by DebanjanB selenium
      Users with the  selenium badge can single-handedly close selenium questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 27 at 21:32


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          0






          active

          oldest

          votes














          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.





          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현