0

I want to log in an website https://eokulyd.meb.gov.tr/ and read some html from that.

But the website has an control image, user must write number which is in that image.

I know requests has Session class that allow us to log in websites, But when I use requests I cant take that control image.

I think that image is loading by JavaScript when website is opening.

Is there any way to use requests or should i use selenium? If I should use selenium, is there any way to use selenium while log in, and then use requests?

4
  • 3
    You're trying to get around a captcha by some automation? That's exactly what the captcha is there to prevent. Commented Nov 13, 2019 at 21:10
  • you probably need something with a real browser that executs java script like for example selenium. I think you could be able to extract cookies from selenium, though I'm not 100% sure. If you are able to extract cookies, then you can pass the session cookies and others to requests and continue from there. Commented Nov 13, 2019 at 22:59
  • Yes you can absolutely pass selenium cookies to requests, I've done it many times. Commented Nov 14, 2019 at 0:30
  • @pguardiario can you share a code example or a source about passing selenium cookies to requests? Commented Nov 15, 2019 at 18:29

1 Answer 1

1

I believe it's something along the lines of:

session = requests.Session() session.cookies.update(driver.getCookies()) 

https://webdriver.io/docs/api/browser/getCookies.html

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.