472,782 Members | 1,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 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 3746
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.