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 in Python by Arvind
• 2,960 points

edited Jun 28 by Arvind 44 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 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,520 points

edited Dec 11, 2018 by Nymeria 1,049 views
0 votes
2 answers

How to use threading in Python?

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

answered Apr 6 in Python by anonymous
108 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
• 56,900 points
46 views
0 votes
1 answer

How to use string.replace() in python 3.x

replace() is a method of <class 'str'> ...READ MORE

answered Aug 3, 2018 in Python by Priyaj
• 56,900 points
90 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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 328 views
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 in Python by Neel
• 3,010 points
28 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 in Python by Neel
• 3,010 points
38 views