How to open a webpage and search for a word in python?
相关问题
- Angular RxJS mergeMap types
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
How to open a webpage?
I think the most convinient way is:
How to search for a word?
I guess you are going to search for some pattern in the page next, so here we go:
you can use urllib2
hope that helps :D
This is a little simplified:
First, get the page (e.g. via
urllib.urlopen
). Second use a regular expression to find portions of the text, you are interested in. Or usestring.find
.