473,769 Members | 6,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connect to https unpossible. Please help.

Hi,

i want to log via python script to https page:

'https://brokerjet.ecetr a.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"(cert ificates, etc)?
Thank u very much !

sincerely mark

Code:
======
import urllib2

theurl='https://brokerjet.ecetr a.com/at/'
#
username = 'username'
password = 'password'
passman = urllib2.HTTPPas swordMgrWithDef aultRealm()
passman.add_pas sword(None, theurl, username, password)
authhandler = urllib2.HTTPBas icAuthHandler(p assman)
opener = urllib2.build_o pener(authhandl er)
urllib2.install _opener(opener)
t = urllib2.urlopen ('https://brokerjet.ecetr a.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(ur l, 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(ht tplib.HTTPS, req)
File "C:\Program Files\python233 \lib\urllib2.py ", line 886, in do_open
raise URLError(err)
urllib2.URLErro r: <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 2639
"Mark Delon" <ma********@gmx .at> wrote:

i want to log via python script to https page:

'https://brokerjet.ecetr a.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"(cert ificates, 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("ht tps://brokerjet.ecetr a.com/at/trading/wt.phtml?isin=N L0000240000&exi d=ETR")
File "C:\Programme\P ython24\lib\url lib2.py", line 358, in open
response = self._open(req, data)
File "C:\Programme\P ython24\lib\url lib2.py", line 376, in _open
'_open', req)
File "C:\Programme\P ython24\lib\url lib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Programme\P ython24\lib\url lib2.py", line 1029, in https_open
return self.do_open(ht tplib.HTTPSConn ection, req)
File "C:\Programme\P ython24\lib\url lib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLErro r: <urlopen error (10061, 'Connection refused')>

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

import os, cookielib, urllib2

cj = cookielib.Mozil laCookieJar()
os.environ['HOME']= r"C:\tmp\COOKIE "
cj.load(os.path .join(os.enviro n["HOME"], "cookies.tx t"))
opener = urllib2.build_o pener(urllib2.H TTPCookieProces sor(cj))
# first URLs download works
r =
opener.open("ht tp://brokerjet.ecetr a.com/at/news/index.phtml?not ation=7536885")
# second URLs download DOES NOT work ... WHY?
r =
opener.open("ht tps://brokerjet.ecetr a.com/at/trading/wt.phtml?isin=N L0000240000&exi d=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*********@pyt hon.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.ecetr a.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"(cert ificates, 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
5689
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 http://www.BetterVssRemoting.com Better VSS Remote Access Tool This article makes a detailed comparison among SourceAnyWhere 4.0, SourceOffSite 4.1, VSS Connect 1.5, SourceXT 2.1, VSS Remoting 2.5,
0
1899
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 was closed: Could not establish secure channel for SSL/TLS. at System.Net.HttpWebRequest.CheckFinalStatus() at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) at
0
334
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 getting the following error: An unhandled exception of type 'System.Net.WebException' occurred in system.dll Additional information: The underlying connection was closed: Unable to connect to the remote server.
4
6531
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 method URLs. However, when we switched to using a secure connection, the call to webReference.SetUrl( "https://test.example.com..." ) no longer functions. The SetUrl() method is actually successful, but any following calls in to the web...
2
2393
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 = CType(WebRequest.Create(goSettings.NHSDPBClaimsURL), HttpWebRequest) nc = New NetworkCredential(goSettings.NHSUserName, goSettings.NHSPassword)
4
2103
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 are used by external users. I have not got a clue how to go about this. My users are authenticated directly by querying a sql table where the user names and passwords are stored. What do I need to do to my application or IIS so that internal...
1
1983
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 me out ............ Sachin
2
1629
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 change the web reference to a proper server the application is not able to communicate with it. If I right click the web reference in VS2005 and click update web reference then I get an error that it could be loaded from http://serveraddress, even though...
0
10017
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 when you configured PHP?) in XXXXXXXXXXXXXX on line 84 I have contacted my host to make sure that ssl and all that is enabled he says it has been enabled and it still dont work here is my server info http://www.performancebux.com/info.php If...
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.