Re: URL - Python ?

2015-02-17 Thread Emil Oppeln-Bronikowski



I would want to know if it's possible to trace the url to the new location


If the webmaster did a proper thing you'll get server 3xx HTTP header 
that will point you to new URL.


http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection

If you're using a good library to do your HTTP (like requests) the 
URL-following is build in and free



r  =  requests.get('http://github.com')
r.url

'https://github.com/'

r.status_code

200

r.history

[Response [301]]

If you want to track changes just check if response.history has some items in 
it.

--

Emil Oppeln-Bronikowski *|* http://fuse.pl
-- 
https://mail.python.org/mailman/listinfo/python-list


URL - Python ?

2015-02-17 Thread Josef Achkar
Hi i was wondering if it's possible to trace a website.
If im for example is interested of the content of www.example.com/cars/audi
and i have noticed that they are changing all URL's on the site so it dosent 
change at all and that it always stays the same like for example 
www.example.com and that i want to still be able to visit the page using 
www.example.com/cars/audi

I would want to know if it's possible to trace the url to the new location 
-- 
https://mail.python.org/mailman/listinfo/python-list