0

For privacy concerns, I cannot distribute the url publicly.

I have been able to access this site successfully using python requests session = requests.Session(); r = session.post(url, auth = HttpNtlmAuth(USERNAME, PASSWORD), proxies = proxies) which works great and I can parse the webpage with bs4. I have tried to return cookies using session.cookies.get_dict() but it returns an empty dict (assuming b/c site is hosted using sharepoint). My original thought was to retrieve cookies then use them to access the site.

The issue that I'm facing is when you redirect to the url, a box comes up asking for credentials - which when entered directs you to the url. You can not inspect the page that the box is on- which means that I can't use send.keys() etc. to login using selenium/chromedriver.

I read through some documentation but was unable to find a way to enter pass/username when calling driver = webdriver.Chrome(path_driver) or following calls.

Any help/thoughts would be appreciated.

When right clicking the below - no option to inspect webpage.

enter image description here

19
  • Are you using selenium or requests? Pick one, don't mix them. Commented Mar 2, 2021 at 18:57
  • Read above - I tried using requests to pass cookies to selenium and then log in. There is no way to use selenium to my knowledge to send.keys to a site that does not provide html inspection, etc. I also need to interact with the site, so I need to use a webdriver to perform tasks. I.e. there may be no way around it except combining the two. If you have knowledge of some good http authentications that work well with selenium please direct them my way. Commented Mar 2, 2021 at 19:01
  • 1
    Hmm interesting. I was actually able to login using r = session.post(url, auth = HttpNtlmAuth(USERNAME, PASSWORD), proxies = proxies) and then parse with bs4. Is that capability due to the HttpNtlmAuth package? Commented Mar 2, 2021 at 19:21
  • 1
    Googling "python selenium ntlm authentication" lead me to stackoverflow.com/questions/56251199/… which might help you here. Commented Mar 2, 2021 at 20:04
  • 1
    Hah - using an encoded separator %5C for the request did the trick. Thank you! Commented Mar 2, 2021 at 20:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.