473,324 Members | 2,002 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.

Accessing Web site contents from a Python script (with use of Cookie)

Hello everyone,

I have been trying to write a Python script to access a Web site.

I'm currently having a problem completing my script because the contents
I would like to access in the Web site is a dynamic content and it is
generated based on the Cookie contents which are set in another page.

url-a (setting Cookies)
url-b (dynamic content based on the Cookie value)

I'm using httplib.HTTPConnection() to first access the url-a to get other info
(and Cookies in header). Then my script accesses the url-b but it doesn't
work as no Cookie info is returned when the url-b is being accessed.

The Cookie values vary time to time such that the script must obtain them
from the url-a. Also, no expiration is set in the Cookies such that they are
supposed to live only in browser not in Cookie files.

Is there any way to handle the situation mentioned above?

Any comments, any hints are highly appreciated.

Best regards,
Aki Niimura
Jul 18 '05 #1
2 3775
On Mon, 2003-07-07 at 23:50, Aki Niimura wrote:
I'm currently having a problem completing my script because the contents
I would like to access in the Web site is a dynamic content and it is
generated based on the Cookie contents which are set in another page.


You should use ClientCookie:
http://wwwsearch.sourceforge.net/ClientCookie/

Ian

Jul 18 '05 #2
Ian Bicking <ia**@colorstudy.com> wrote in message
On Mon, 2003-07-07 at 23:50, Aki Niimura wrote:
I'm currently having a problem completing my script because the contents
I would like to access in the Web site is a dynamic content and it is
generated based on the Cookie contents which are set in another page.


You should use ClientCookie:
http://wwwsearch.sourceforge.net/ClientCookie/


Thank you for getting me know such interesting Python module is available.

I made my script working using HTTPResponse.getheader('Set-Cookie') and
HTTPResponse.putheader('Cookie', cookie). Using ClientCookie would make
such process hidden. I should use it next time.

Thanks!
Aki Niimura
Jul 18 '05 #3

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

Similar topics

5
by: David Rasmussen | last post by:
Some sites seem to be session driven in the sense that if I visit the homepage and do a few clicks I can navigate anywhere I want, but if I paste the current location into a new browser window...
3
by: Raterus | last post by:
Hello, I've got a bunch of web-portals that customers use to log-in and see their data. In a production environment, each of these has a completely different domain name, but they all point back...
4
by: Paul Brant | last post by:
Hi all, I have a page with an IFRAME in it. From a script in the main ( parent ) page I instruct the IFRAME to load a specific URL. The URL contains parameters that are processed by the server....
1
by: milindsj | last post by:
Hello, I have a application hosted on tomcat. I use a jsp to set a cookie say channelid. Now I am redirecting this page to some other appliaction which is hosted in tomcat on some other machine....
9
by: Justin Engelman | last post by:
Hi, I have a website that uses an ISAPI filter that will redirect anyone going to any page on the site to an SSL login page (on a different website with the same root domain) if they do not have...
1
by: onceuponapriori | last post by:
Greetings gents. I'm a Railser working on a django app that needs to do some scraping to gather its data. I need to programatically access a site that requires a username and password. Once I...
4
by: Khafancoder | last post by:
Hi guys, is it possible to access ASP.Net authentication cookie through javascript ? thanx
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
1
by: Hari | last post by:
Hi, I'm working on a winapp that sends a httprequest to a remote server. The server actually sends back a cookie for login request. I have searched a lot. I didn't find the right solution for...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...

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.