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

          Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

          밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

          1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴