1

I am trying to find a method to find the primary domain for a website.

For example: if you visit www.yalochat.com the browser automatically changes the address to www.yalo.com. Therefore:

Input: www.yalochat.com Output: www.yalo.com

Input: www.yalo.com Output: www.yalo.com

Any suggestions?

Thanks!

1
  • what have you attempted so far? context Commented Nov 10, 2021 at 9:39

1 Answer 1

2

You can achieve this with the requests module as follows:

import requests

with requests.Session() as s:
    r = s.get('https://www.yalochat.com')
    r.raise_for_status()
    print(r.url)
Sign up to request clarification or add additional context in comments.

Comments

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.