Trying to make a spider using mechanize

tedpottel at gmail.com tedpottel at gmail.com
Mon Sep 8 18:24:17 CEST 2008


Hi,

I can read the home page using the mechanize lib.  Is there a way to
load in web pages using filename.html instad of servername/
filename.html.  Lots of time the links just have the file name.  I'm
trying to read in the links name and then vsit those pages.

here is the sample code I am ussing.


import ClientForm
import mechanize


#get home page
request = mechanize.Request("http://www.activetechconsulting.com")
response = mechanize.urlopen(request)
print response.read()

#sub page (this does note work)
request = mechanize.Request("service.html")
response = mechanize.urlopen(request)
print response.read-Ted



More information about the Python-list mailing list