| Reply | « Previous Thread | Next Thread » |
|
Hi all,
I am trying to connect to a https site.I am using proxy and certificates also for this.I used browser.open(url) to open the site.When I am trying to run the program I am getting an error as shown below urllib2.URLError: <urlopen error (1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol')> Can anyone help me Why this error is coming?? |
| lalithak85 |
| View Public Profile |
| Find all posts by lalithak85 |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
not sure and also not getting that thread there was a long discussion on https have a look on that i m sure you are talking abt https not http. have a feedback Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Basically server tells that it doesn't understand your data. There could be several reasons for that, for example wrong port, different SSL/TLS versions, faulty installation at server side, buggy libraries at client side.
It's a generic error note, so exact reason and fix cannot be given without more info. Cheers, --jouni |
|
Hi ,
I am very new to python.I have written a code to open up a https site using browser.open(url) and then i want to post data into the form through python. But it is displaying the error as [color="Red"]"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 254, in _mech_open raise response mechanize._response.httperror_seek_wrapper: HTTP Error 400: Bad Request I am using a proxy and also certificates also for authentication purpose.. I am writing the code below .please have a look it and tell me where the error is I am getting the paramters from configuration file import re from mechanize import Browser import sys import os sys.path.append('C:\\') from configobj import ConfigObj cfg = ConfigObj("parameters.ini") site_id=cfg["site_id"] admin_id=cfg["admin_id"] admin_passwd=cfg["admin_passwd"] https_proxy=cfg["proxy"] print site_id print admin_id print admin_passwdos.environ["https_proxy"]=cfg["proxy"] os.environ["https_pkcs12_file11"]=cfg["cert_file"] os.environ["https_pkcs12_password"]=cfg["cert_passwd"] CURRENT_USER_FILE=open("current-users.txt", "w") br=Browser() #proxycheckflag=False br.set_handle_robots(False) br.open(site_id) br.select_form(nr = 1) values1={'password':admin_passwd} values = {'query' :"select user_id, login_name, email, real_name, organization from HELM_USER where HELM_USER.TYPE='base' and DOMAIN_ID=2"} ctrl = browser.getControl(name='Run query') ctrl.click() This is the code Its getting struck at opening a site... Please help me in this regard and tell me where the error is?? |
| lalithak85 |
| View Public Profile |
| Find all posts by lalithak85 |
|
Huh,
Too much unreadable code! Please use [ code ] and [ / code ] tags (without those spaces) to mark code lines, this will make it readable! You can edit your message afterwards to add them. Go to your old message, press EDIT button at the end of the message at the left side. You will see a text box with your writing and some special wiki syntax tags. Add those [ code ] tags and save. When in EDIT mode, there is button GO TO ADVANCED, which is a bit like the original message creation view. There you have PREVIEW button, very useful when you're not quite sure how those tags work. Final tip: look around the other messages and when you see a nice effect (bold, italics, COLOR, code, quote, etc) just press QUOTE button and look at the wiki syntax. Code:
def my_func(a_value):
''' Example '''
my_value = a_value
my_func(5)
Quote:
--jouni |
|
The HTTP/1.1 specification says:
Quote:
--jouni |
|
Hi Jom,
Thanks for your suggestion.I will do it now.But Is there any mistake in my code??WHy is it showing such error. |
| lalithak85 |
| View Public Profile |
| Find all posts by lalithak85 |
|
Hi Jom,
What I have observed is when I am calling browser.open(url).It is calling _mechanize.py which is actually generating the response.What I have observed is in _mechanize.py I tried to print the request and I am observing that it is printed twice.It means that request is going twice..Is there any problem in _mechanize.py???? |
| lalithak85 |
| View Public Profile |
| Find all posts by lalithak85 |
|
Quote:
However the error code told that URL was incorrect, so you might want to print that, copy to desktop web browser and see whether it works from there.Cheers, --jouni who has never used mechanize and cannot answer any such questions |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Parsing file content | hendrawan.ashari | General Symbian C++ | 7 | 2007-03-09 11:41 |
| problem with the XML Parser SyExpat | Vitaly_iva | General Symbian C++ | 2 | 2006-06-05 12:09 |
| codewarrior中编译出错?(每个例子均是一样) | uufile | Symbian | 3 | 2005-09-13 06:37 |
| Cannot compile SDK's examples for 7650 platform... | midletsoft | Symbian Tools & SDKs | 2 | 2003-08-12 20:11 |
| how to avoid linking error | skdas | General Symbian C++ | 6 | 2003-07-07 08:57 |