×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    17

    Problem with Mechanize

    Hi All,

    I have downloaded mechanize zip folder and inch=luded in python's lib folder.I am trying to open the site by using the following code
    from mechanize import browser
    browser=Browser()
    html = browser.open(url)
    But when I run the code it is showing the following error

    File "C:\CRSSTP\New_Workspace\python\test.py", line 51, in <module>
    html = browser.open(url,data='')
    File "C:\Python25\lib\mechanize\_mechanize.py", line 203, in open
    return self._mech_open(url, data)
    File "C:\Python25\lib\mechanize\_mechanize.py", line 229, in _mech_open
    response = UserAgentBase.open(self, request, data)
    File "C:\Python25\lib\mechanize\_opener.py", line 181, in open
    response = urlopen(self, req, data)
    File "C:\Python25\lib\urllib2.py", line 392, in _open
    '_open', req)
    File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
    result = func(*args)
    File "C:\Python25\lib\mechanize\_auth.py", line 105, in <lambda>
    meth(r, proxy, type))
    File "C:\Python25\lib\mechanize\_auth.py", line 128, in proxy_open
    return self.parent.open(req)
    File "C:\Python25\lib\mechanize\_mechanize.py", line 203, in open
    return self._mech_open(url, data)
    File "C:\Python25\lib\mechanize\_mechanize.py", line 229, in _mech_open
    response = UserAgentBase.open(self, request, data)
    File "C:\Python25\lib\mechanize\_opener.py", line 181, in open
    response = urlopen(self, req, data)
    File "C:\Python25\lib\urllib2.py", line 397, in _open
    'unknown_open', req)
    File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
    result = func(*args)
    File "C:\Python25\lib\urllib2.py", line 1133, in unknown_open
    raise URLError('unknown url type: %s' % type)
    urllib2.URLError: <urlopen error unknown url type: c>
    Can anyone please help me in this regard?/

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Problem with Mechanize

    hi laithak85
    first of all i advise you when you next time post any code please use the quotes provided.
    As far as your problem is concerned have you properly installed mechanize as a lib module.
    moreover if you want to open the browser there is a code in python category of wiki for that have a look at that.
    hope this will solve your problem.
    feel free for a feedback

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    3

    Re: Problem with Mechanize

    Code:
    urllib2.URLError: <urlopen error unknown url type: c>
    Suggests that there is something wrong with your url. You're trying to open "c:\some_file.html" aren't you? That's not an url, hence the error. Try "file:///c:/some_file.html" instead.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    9

    Re: Problem with Mechanize

    I am also having difficulty trying to use mechanize.
    Did you find a way to solve this problem?

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×