Folks,
I am working on a scraping script which is running once a day where I need to re-authenticate my account.
First I have to login and then only I can see the page. Like normal page login and scrapping this won't work (read in articles and used the code below as suggested on most of the blogs and forumns) This still doesn't work.
It's an https website.
URL: https://www2.somewebsite.com/mypage.php
Now I have this code:
def InitializeBrowser():
browser = webdriver.Firefox()
browser.set_window_size(1120, 550)
return browser
def CheckTest(request):
browser = InitializeBrowser()
data = browser.get("https://gitroix:Ju2R4kmb@www2.sfmx.org/camera.php")
alert = browser.switch_to_alert()
alert.accept()
browser.close()
return HttpResponse(data.contents)
However the above code doesn't fills in the data in popup box fields, not clicks on Login.
What would be the issue?
EDIT 1:
I did tried this from How to Submit HTTP authentication with Selenium python-binding webdriver
But no success either.
profile = webdriver.FirefoxProfile()
profile.set_preference('network.http.phishy-userpass-length', 255)
driver = webdriver.Firefox(firefox_profile=profile)
driver.get("https://username:password@somewebsite.com/")

