I'm trying to use urllib.openurl() like that:
import urllib
html = urllib.request.urlopen(url="https://www.otcmarkets.com")
But it just doesn't work for some reason. If I give different HTTPS url like 'https://www.google.com' it works but for some websites like this one I just can't open the url. Can I do something to make it work? Do you have another way to extract html from website?
The website checks if you set a User-Agent in the headers. The requests-package makes it easy to use urllib.
You can do what you want by using something like that: