its showing http error ..im new to crawling using py | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

its showing http error ..im new to crawling using py

import re import urllib.request url = "https://finance.google.com/finance?q= " stock = input("enter your stock: ") url = url + stock data = urllib.request.urlopen(url).read() data1 = data.decode("utf-8") print(data1)

2nd Feb 2018, 6:51 PM
Rahul Viswam
Rahul Viswam - avatar
3 Answers
+ 6
Try using "requests" module, instead of "urllib.request" when https doesn't seem to work.
2nd Feb 2018, 7:49 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
thank you now its working
3rd Feb 2018, 6:53 AM
Rahul Viswam
Rahul Viswam - avatar
+ 2
I updated my version of Python and urllib above code works fine😆
4th Feb 2018, 12:42 PM
Rahul Viswam
Rahul Viswam - avatar