I want to access websites without using their API. Would i do this by using something like Mechanize?
The technique of automating the web with Python works great for many tasks, both general and in my field of data science. For example, we could use selenium to automatically download new data files every day (assuming the website doesn't have an API).
To get data from a website while programming, we need to open the URL. In this Article, I have discussed the methods to open URLs in python on Ubuntu (Linux System). Two ways are being discussed with examples, one is by importing the “urllib. request” module and other is by importing the “webbrowser” module in python.
#for Python 3.2
import urllib.request
page = urllib.request.urlopen("http://www.google.com")
print (page.read())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With