473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

connect to https unpossible. Please help.

Hi,

i want to log via python script to https page:

'https://brokerjet.ecetra.com/at/'
#
But it does not work.

I am using following code(see below)

Has somebody any ideas?
How can I get to this https page?
Need I to know some infos from "provider"(certificates, etc)?
Thank u very much !

sincerely mark

Code:
======
import urllib2

theurl='https://brokerjet.ecetra.com/at/'
#
username = 'username'
password = 'password'
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, theurl, username, password)
authhandler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(authhandler)
urllib2.install_opener(opener)
t = urllib2.urlopen('https://brokerjet.ecetra.com/at/')
#
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Program Files\python233\lib\urllib2.py", line 129, in urlopen
return _opener.open(url, data)
File "C:\Program Files\python233\lib\urllib2.py", line 326, in open
'_open', req)
File "C:\Program Files\python233\lib\urllib2.py", line 306, in _call_chain
result = func(*args)
File "C:\Program Files\python233\lib\urllib2.py", line 908, in https_open
return self.do_open(httplib.HTTPS, req)
File "C:\Program Files\python233\lib\urllib2.py", line 886, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (10060, 'Operation timed out')>
--
Highspeed-Freiheit. Bei GMX supergünstig, z.B. GMX DSL_Cityflat,
DSL-Flatrate für nur 4,99 Euro/Monat* http://www.gmx.net/de/go/dsl
Oct 19 '05 #1
2 2614
"Mark Delon" <ma********@gmx.at> wrote:

i want to log via python script to https page:

'https://brokerjet.ecetra.com/at/'
#
But it does not work.

I am using following code(see below)

Has somebody any ideas?
How can I get to this https page?
Need I to know some infos from "provider"(certificates, etc)?
Thank u very much !


You are trying to set this up to use HTTP BasicAuth authorization, but this
page is not using HTTP authorization. You can recognize HTTP authorization
by the separate browser window that pops up to ask for your username and
password.

In this case, the username and password fields are just ordinary fields on
a form. What you need to do is read the HTTP on that page, and figure out
how to send a URL containing values for those fields. In this case, the
form data goes to
https://brokerjet.ecetra.com/at/welc...inaction.phtml, and you'll need
to encode 'login' and 'pwd' fields in the POST data.

However, that isn't the end of your trouble. That page will almost
certainly send you a cookie, which you will need to send back with every
request.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 21 '05 #2
Hi Tim,

really than u very much!

I think u have helped me!

I will try, that what u said.

I have found probably simplier solution.
Is it so?

....but without success:-(.

I want to download some URLs via python script.
With some URLs I have success with some NOT.
Why?
I do following:
===============
1. Login to https://brokerjet.ecetra.com/at/welc...oginpage.phtml
via Mozzila browser
2. I try to download some URLs using cookies: see script bellow:
3. Some pages works (e.g. news, but on some pages I get:
--
Traceback (most recent call last):
File "test_stock.py", line 11, in ?
r =
opener.open("https://brokerjet.ecetra.com/at/trading/wt.phtml?isin=NL0000240000&exid=ETR")
File "C:\Programme\Python24\lib\urllib2.py", line 358, in open
response = self._open(req, data)
File "C:\Programme\Python24\lib\urllib2.py", line 376, in _open
'_open', req)
File "C:\Programme\Python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Programme\Python24\lib\urllib2.py", line 1029, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Programme\Python24\lib\urllib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (10061, 'Connection refused')>

Details- Script:
=================
I make login via Mozilla browser

import os, cookielib, urllib2

cj = cookielib.MozillaCookieJar()
os.environ['HOME']= r"C:\tmp\COOKIE"
cj.load(os.path.join(os.environ["HOME"], "cookies.txt"))
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(c j))
# first URLs download works
r =
opener.open("http://brokerjet.ecetra.com/at/news/index.phtml?notation=7536885")
# second URLs download DOES NOT work ... WHY?
r =
opener.open("https://brokerjet.ecetra.com/at/trading/wt.phtml?isin=NL0000240000&exid=ETR")
#
h = r.readlines()
g = open("test.html","w")
g.writelines(h)
g.close()
os.system("test.html")

Thans realy for all ideas!
sincerely
mark
--- Ursprüngliche Nachricht ---
Von: Tim Roberts <ti**@probo.com>
An: py*********@python.org
Betreff: Re: connect to https unpossible. Please help.
Datum: Fri, 21 Oct 2005 06:05:45 GMT

"Mark Delon" <ma********@gmx.at> wrote:

i want to log via python script to https page:

'https://brokerjet.ecetra.com/at/'
#
But it does not work.

I am using following code(see below)

Has somebody any ideas?
How can I get to this https page?
Need I to know some infos from "provider"(certificates, etc)?
Thank u very much !


You are trying to set this up to use HTTP BasicAuth authorization, but
this
page is not using HTTP authorization. You can recognize HTTP
authorization
by the separate browser window that pops up to ask for your username and
password.

In this case, the username and password fields are just ordinary fields on
a form. What you need to do is read the HTTP on that page, and figure out
howfiues for those fields. In this case, the
form data goes to
https://brokerjet.ecetra.com/at/welc...inaction.phtml, and you'll need
to encode 'login' and 'pwd' fields in the POST data.

However, that isn't the end of your trouble. That page will almost
certainly send you a cookie, which you will need to send back with every
request.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list


--
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie
Oct 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
0
by: Subra Mallampalli | last post by:
Hi, I am trying to connect over HTTPS using a client certificate. I am able to connect fine when using IE. From my application, however, I get the following error: The underlying connection...
0
by: Krishna | last post by:
Well, I got it working when running against my test server (IIS5 W2K svr, I will attach a sample of the code at the bottom of this message), but now I'm connecting to our client (Apache) I'm...
4
by: Jason P | last post by:
Basically we have a web method with a dynamic URL. The client is developed in C++ and I've been using the webReference.SetUrl( "http://test.example.com..." ) method successfully with various web...
2
by: leeo | last post by:
This is driving me absolutely mad. We've been using this code to connect to a remote site: System.Net.ServicePointManager.CertificatePolicy = New cCertificatePolicy wr =...
4
by: bkasmai | last post by:
My asp.net application (developed using vs2003) runs fine on a windows 2000 server using iis 5.0. Our network manager wants to do away with any http connections and only use https for services that...
1
by: gujarsachin2001 | last post by:
Hello friends, I want to connect http or https by taking url, username & password from user (if necessary )& then connect to download file from that source in console application. Can u help...
2
by: alag20 | last post by:
Hi, This is another issue and not related with the other Q I posted for proxy. I am implementing a MTOM server similar to example here This works fine on my local machine but as soon as I...
0
by: smokenlinks | last post by:
I am working on a script and i get this error Warning: fsockopen() : unable to connect to https://www.alertpay.com:443 (Unable to find the socket transport "https" - did you forget to enable it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.