how to use urllib module in python?

0 votes
I want to visit a website a fetch data from it. How to do it in Python using urllib module?
Jun 28, 2019 in Python by Arvind
• 2,980 points

edited Jun 28, 2019 by Arvind 116 views

1 answer to this question.

0 votes

If you are using Python 3.x then you need to use urllib module. Refer to the following code as an example.

from urllib.request import urlopen
web = urlopen("http://www.google.com/")
print(web)
answered Jun 28, 2019 by Neel
• 3,010 points

Related Questions In Python

0 votes
1 answer

How do I use urllib to see if a website is 404 or 200 in Python?

For Python 3, try doing this: import urllib.request, ...READ MORE

answered Nov 29, 2018 in Python by Nymeria
• 3,540 points

edited Dec 11, 2018 by Nymeria 4,665 views
0 votes
1 answer

How to fetch HTML code using urllib module in Python?

Hi@akhtar, You can use urllib module to fetch ...READ MORE

answered Jun 26 in Python by MD
• 35,300 points
28 views
0 votes
2 answers

How to use threading in Python?

 Thread is the smallest unit of processing that ...READ MORE

answered Apr 6, 2019 in Python by anonymous
220 views
0 votes
1 answer

How to use “raise” keyword in Python

You can use it to raise errors ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 57,530 points
105 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,096 views
0 votes
0 answers
0 votes
1 answer

How to install and use myql connector in Python?

You can use pip to search if ...READ MORE

answered Jul 5, 2019 in Python by Neel
• 3,010 points
199 views
0 votes
1 answer

How to check if a given string matches a particular pattern in Python?

You can use re module of python ...READ MORE

answered Jul 3, 2019 in Python by Neel
• 3,010 points
140 views