User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 402,052 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,454 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 206 | Replies: 1
Reply
Join Date: Aug 2008
Posts: 1
Reputation: k9triz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
k9triz k9triz is offline Offline
Newbie Poster

the 'mechanize' library

  #1  
28 Days Ago
I've been playing around with this library called 'mechanize' for automated form-filling ( http://wwwsearch.sourceforge.net/mechanize/ ).

Now, I've tried this library across a number of websites, but although it works on some, on others I get an error saying -
mechanize._html.ParseError: ParseError(ParseError(SGMLParseError("unexpected char 'u' in internal subset",),),)

I also tried the offending websites with another similar librarty called ClientForm:

from ClientForm import ParseResponse
from urllib2 import urlopen

response = urlopen("http://www.bairstoweves.co.uk/")
forms = ParseResponse(response, backwards_compat=False)
form = forms[0]
print urlopen(form.click()).read()
-- same error

can anyone tell me what this error means and how I can fix it? as there is no proper documentation out there for these libraries besides the docstrings (not very helpful)
Last edited by Tekmaven : 28 Days Ago at 3:45 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,425
Reputation: vegaseat will become famous soon enough vegaseat will become famous soon enough 
Rep Power: 9
Solved Threads: 173
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
Kickbutt Moderator

Re: the 'mechanize' library

  #2  
28 Days Ago
Looks like the library you have does not know how to handle unicode characters.
May 'the Google' be with you!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Python Forum

All times are GMT -4. The time now is 11:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC