Chromeheadless throwing blank page as screenshot in url redirection










0















I have written code in python selenium and the code is working fine without chromeheadless. When using chromheadless first part (please see below code) of login is working fine



def login():
myProxy = "ipaddress:8080"
chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')
chrome_options.add_argument('--proxy-server=%s' % myProxy )
driver= webdriver.Chrome(executable_path=
'C:\Scripts\test\driver\chromedriver',
chrome_options=chrome_options,
service_args=["--verbose", "--log-
path=C:\Scripts\qc1.log"])

driver.get("http://apps.cloudhealthtech.com/dashboard")
driver.find_element_by_tag_name('button').send_keys(Keys.ENTER)
driver.find_element_by_id('email_input').send_keys("emailid")
driver.find_element_by_id('login_button').send_keys(Keys.ENTER)
driver.get_screenshot_as_file("capture.png")


Till above part it works fine, but after this url redirects for single sign on and below code does not work.



time.sleep(5)

keyboard.press_and_release('tab')
keyboard.press_and_release('shift + tab')
time.sleep(2)
keyboard.write("username", delay=1)
time.sleep(5)
keyboard.press_and_release('tab')
time.sleep(5)
keyboard.write("password", delay=1)
time.sleep(2)
keyboard.press_and_release('enter')


It should enter username and password in popup, but its showing blank page in snapshot



See below error in log



1542283010.243][DEBUG]: DevTools WebSocket Event: Log.entryAdded 0C8ED5D1D48339211778F73D59D23A89 {
"entry": {
"level": "error",
"networkRequestId": "CE55C95230B89FC3D3783AD07E45779C",
"source": "network",
"text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)",
"timestamp": 1542283010238.73,









share|improve this question
























  • Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

    – Kamal
    Nov 19 '18 at 5:19















0















I have written code in python selenium and the code is working fine without chromeheadless. When using chromheadless first part (please see below code) of login is working fine



def login():
myProxy = "ipaddress:8080"
chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')
chrome_options.add_argument('--proxy-server=%s' % myProxy )
driver= webdriver.Chrome(executable_path=
'C:\Scripts\test\driver\chromedriver',
chrome_options=chrome_options,
service_args=["--verbose", "--log-
path=C:\Scripts\qc1.log"])

driver.get("http://apps.cloudhealthtech.com/dashboard")
driver.find_element_by_tag_name('button').send_keys(Keys.ENTER)
driver.find_element_by_id('email_input').send_keys("emailid")
driver.find_element_by_id('login_button').send_keys(Keys.ENTER)
driver.get_screenshot_as_file("capture.png")


Till above part it works fine, but after this url redirects for single sign on and below code does not work.



time.sleep(5)

keyboard.press_and_release('tab')
keyboard.press_and_release('shift + tab')
time.sleep(2)
keyboard.write("username", delay=1)
time.sleep(5)
keyboard.press_and_release('tab')
time.sleep(5)
keyboard.write("password", delay=1)
time.sleep(2)
keyboard.press_and_release('enter')


It should enter username and password in popup, but its showing blank page in snapshot



See below error in log



1542283010.243][DEBUG]: DevTools WebSocket Event: Log.entryAdded 0C8ED5D1D48339211778F73D59D23A89 {
"entry": {
"level": "error",
"networkRequestId": "CE55C95230B89FC3D3783AD07E45779C",
"source": "network",
"text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)",
"timestamp": 1542283010238.73,









share|improve this question
























  • Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

    – Kamal
    Nov 19 '18 at 5:19













0












0








0








I have written code in python selenium and the code is working fine without chromeheadless. When using chromheadless first part (please see below code) of login is working fine



def login():
myProxy = "ipaddress:8080"
chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')
chrome_options.add_argument('--proxy-server=%s' % myProxy )
driver= webdriver.Chrome(executable_path=
'C:\Scripts\test\driver\chromedriver',
chrome_options=chrome_options,
service_args=["--verbose", "--log-
path=C:\Scripts\qc1.log"])

driver.get("http://apps.cloudhealthtech.com/dashboard")
driver.find_element_by_tag_name('button').send_keys(Keys.ENTER)
driver.find_element_by_id('email_input').send_keys("emailid")
driver.find_element_by_id('login_button').send_keys(Keys.ENTER)
driver.get_screenshot_as_file("capture.png")


Till above part it works fine, but after this url redirects for single sign on and below code does not work.



time.sleep(5)

keyboard.press_and_release('tab')
keyboard.press_and_release('shift + tab')
time.sleep(2)
keyboard.write("username", delay=1)
time.sleep(5)
keyboard.press_and_release('tab')
time.sleep(5)
keyboard.write("password", delay=1)
time.sleep(2)
keyboard.press_and_release('enter')


It should enter username and password in popup, but its showing blank page in snapshot



See below error in log



1542283010.243][DEBUG]: DevTools WebSocket Event: Log.entryAdded 0C8ED5D1D48339211778F73D59D23A89 {
"entry": {
"level": "error",
"networkRequestId": "CE55C95230B89FC3D3783AD07E45779C",
"source": "network",
"text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)",
"timestamp": 1542283010238.73,









share|improve this question
















I have written code in python selenium and the code is working fine without chromeheadless. When using chromheadless first part (please see below code) of login is working fine



def login():
myProxy = "ipaddress:8080"
chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')
chrome_options.add_argument('--proxy-server=%s' % myProxy )
driver= webdriver.Chrome(executable_path=
'C:\Scripts\test\driver\chromedriver',
chrome_options=chrome_options,
service_args=["--verbose", "--log-
path=C:\Scripts\qc1.log"])

driver.get("http://apps.cloudhealthtech.com/dashboard")
driver.find_element_by_tag_name('button').send_keys(Keys.ENTER)
driver.find_element_by_id('email_input').send_keys("emailid")
driver.find_element_by_id('login_button').send_keys(Keys.ENTER)
driver.get_screenshot_as_file("capture.png")


Till above part it works fine, but after this url redirects for single sign on and below code does not work.



time.sleep(5)

keyboard.press_and_release('tab')
keyboard.press_and_release('shift + tab')
time.sleep(2)
keyboard.write("username", delay=1)
time.sleep(5)
keyboard.press_and_release('tab')
time.sleep(5)
keyboard.write("password", delay=1)
time.sleep(2)
keyboard.press_and_release('enter')


It should enter username and password in popup, but its showing blank page in snapshot



See below error in log



1542283010.243][DEBUG]: DevTools WebSocket Event: Log.entryAdded 0C8ED5D1D48339211778F73D59D23A89 {
"entry": {
"level": "error",
"networkRequestId": "CE55C95230B89FC3D3783AD07E45779C",
"source": "network",
"text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)",
"timestamp": 1542283010238.73,






python selenium selenium-webdriver selenium-chromedriver






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 2:30







Praneeta Kumari

















asked Nov 15 '18 at 7:29









Praneeta KumariPraneeta Kumari

11




11












  • Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

    – Kamal
    Nov 19 '18 at 5:19

















  • Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

    – Kamal
    Nov 19 '18 at 5:19
















Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

– Kamal
Nov 19 '18 at 5:19





Try the debugging method explained here[developers.google.com/web/updates/2017/04/…, just add one more argument specifying debugging port in you code and check if you can see what is going wrong.

– Kamal
Nov 19 '18 at 5:19












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314376%2fchromeheadless-throwing-blank-page-as-screenshot-in-url-redirection%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314376%2fchromeheadless-throwing-blank-page-as-screenshot-in-url-redirection%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto