Take the 2-minute tour ×  I would like to extract all links from
a web page. Here is my code so far.  import mechanize import
lxml.html from time import sleep  links = list() visited_links =
list()  br = mechanize.Browser()  def findLinks(url):
response = br.open(url)      for link in br.links():
response = br.follow_link(link)   for link in links:     if link
in visited_links:         print link  for link in visited_links:
print link  In fact I don't want to write a web crawler. What
I'd like to do is extract all links from a web page and create a
site map. I also wonder whether is it possible to get last
modification time of a file from server using mechanize and
python.  What I'd like to ask is while this code snippet works
fine for HTML pages. It doesn't extract links from php pages.
For example this page. How can I extract links from php pages?
Any help would be appreciated. Thanks..  share|improve this
question  3 Answers 3  up vote 1 down vote accepted  I don't
know mechanize, but I ha