python download url data

rex posted @ Aug 21, 2010 06:37:26 AM in 编程笔记 with tags python , 1749 readers

To download something in python, it is good to use urllib2.Request other than urllib2.urlopen. the reason is, the former can handle 302 redirection automatically. the core part of che code is as below.


#!/usr/bin/env python

from urllib2 import Request, urlopen


while 1:
    if not len(data):



turn on cookies in c said:
May 11, 2019 04:34:53 PM

this site give me full tutorial an easy way like to watch the tutorial.

turn on cookies in c said:
May 31, 2019 05:37:59 PM

this site give me full tutorial an easy way like to watch the tutorial. said:
Mar 16, 2020 06:16:07 PM

Usually I don’t read post on blogs, but I wish to say that this write-up very forced me to try and do so! Your writing style has been surprised me. Thanks, very nice post. said:
Apr 08, 2020 06:16:57 PM

Dev Patel showed his great acting skills on SlumDog Millionaire, i would love to see more of his movies,. <a href=""></a>

best CBD gummies said:
Apr 29, 2020 04:20:27 PM

I just added this weblog to my rss reader, great stuff. Cannot get enough!

best CBD gummies said:
May 04, 2020 07:19:45 PM

Merely wanna input that you have a very decent site, I like the style and design it really stands out.

best CBD oil said:
May 09, 2020 01:49:06 AM

This sort of thing needs to happen! Get motivated and get pissed off. Now this will let you take the next steps to becoming successful.

Digital Business Gro said:
May 20, 2020 05:16:14 AM

Super site! I am Loving it!! Will return once more, Im taking your food additionally, Thanks.

Robinjack said:
May 29, 2020 08:57:34 PM

The FDA also has MedWatch, which can be added to websites so consumers can be alerted to recent products which have tested positive for adulterants. anastrozole bodybuilding

Robinjack said:
May 30, 2020 12:02:14 AM

The fact that only a few of them are manufactured once in a while also makes it more attractive to collectors. uzi for sale

Robinjack said:
May 30, 2020 11:16:35 PM

You'll need some kind of garden shed or outhouse at the very least, but if you have this, growing mushrooms on a medium to large scale should be fairly easy. magic mushrooms usa

Robinjack said:
Jun 09, 2020 06:43:53 PM

But, how do you know if an online casino is right for you? What are the things to consider in deciding a casino to sign up with? If you are confused which one to go for, below are the 4 tips that will definitely give you some hints. ดูบอล

Asharseo said:
Jun 22, 2020 05:25:32 PM

I’m impressed, I must say. Truly rarely can i encounter a blog that’s both educative and entertaining, and without a doubt, you might have hit the nail around the head. Your concept is outstanding; the issue is something there are not enough folks are speaking intelligently about. I am happy i always came across this within my seek out something with this. slot indonesia

Asharseo said:
Jun 22, 2020 05:25:38 PM

eating disorders are of course sometimes deadly because it can cause the degeneration of one’s health., agen ion casino

Robinjack said:
Jun 24, 2020 10:28:19 PM

Accommodations are, short of transcontinental airfare, your biggest expense on any trip or vacation. Even with a depressed economy, hotels and inns are still what they've always been - expensive. Short term rentals are an easier option for accommodations, especially if you won't be there more than a couple of weeks. Here's a quick guide to pulling it off. training room rental singapore

shahmeerkhan said:
Jun 25, 2020 07:17:00 PM

It is also possible to place bets without leaving the comfort of our bedroom. เดิมพันฟุตบอล

Robinjack said:
Jun 27, 2020 12:47:27 AM

Inbound links or incoming links, are links that are pointing to your site. It is very important to constantly work on getting incoming links to your site for optimal Google SEO Ranking. Google sees every incoming link as a vote of confidence from a certain website so it's important that in time your site receives and ever-growing number of "votes". To get the most out of the incoming links, they should use for link title your main keywords. seo company service

Asharseo said:
Jun 27, 2020 11:39:44 PM

I’ve bookmarked your blog simply because I really like it. judi slot

Asharseo said:
Jun 27, 2020 11:39:58 PM

The idea of sending a squad in a ‘copter and getting in and out hours before the bombing doesn’t seem to be an option even though there are helicopters all over the place, never seeming to be doing anything worthwhile. slot online

thenex789 said:
Jun 28, 2020 04:28:40 PM

My cell phone does not appear the option of biometrics could someone help me !! <a href="">visit the website</a>

thenex789 said:
Jun 28, 2020 04:29:24 PM

My cell phone does not appear the option of biometrics could someone help me !! <a href="">visit the website</a>

thenex789 said:
Jun 28, 2020 04:29:53 PM


My cell phone does not appear the option of biometrics could someone help me !! [url=]visit the website[/url]


visit the website said:
Jun 28, 2020 04:30:22 PM


My cell phone does not appear the option of biometrics could someone help me !!


Asharseo said:
Jun 29, 2020 01:19:12 AM

I found so many interesting stuff in your blog!! especially its discussionLaugh ing From the tons of comments on your articlesSmile I guess I am not the only one having all the enjoyment hereSmile Keep up the excellent work!! Arizona gold nuggets for sale

Asharseo said:
Jun 30, 2020 12:09:20 AM

Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I will certainly return. hechizos de amor caseros

shahmeerkhan said:
Jul 02, 2020 12:36:38 PM

The next occasion I read a weblog, Lets hope it doesnt disappoint me as much as that one. I am talking about, I know it was my method to read, but I really thought youd have some thing fascinating to mention. All I hear is actually a number of whining about something you could fix if you ever werent too busy searching for attention. handyman services Biloxi

Robinjack said:
Jul 03, 2020 07:10:40 PM

Overall, as I have mentioned throughout, it is with regret that I concede that Italy, given all of their difficulties, cannot compete. This upsets me, as it was Serie A where I gained much of my development as a football supporter, spending years enjoying the delights of the Mediterranean game, watching exotically monikered players with equally glamorous abilities. It is true that the average Italian top flight footballer is of higher fundamental ability than his English counterpart, but the stigma of scandal is too apparent in the current Serie A climate for them to be considered. It is my hope that we see a renaissance in Italian football and that over the coming decade we see a nation rejuvenated and again rivaling their Spanish and English counterparts.   ข่าวบอล

Asharseo said:
Jul 04, 2020 12:13:14 AM

Being grateful for for your post. I know that throughout today’s complicated world, folks have many beliefs and this has made it to be very difficult for learners much like me. However, you have made it very easy for me to fully grasp and I now have in mind the correct thing. Your continued reputation as one of the top experts on this topic may be increased through words with appreciation from visitors like me. Thanks, again. slot online

Robinjack said:
Jul 04, 2020 06:46:25 PM

Online dating has become the fashionable new craze. If you have recently split up from your partner and are seeking a new relationship, there are hundreds of services online which can help you meet your future love. There are thousands of fortunate cases where people have got married as a result of online dating. To ensure you get the best experience, it is important to act with caution and follow a few simple rules which will help keep you safe: skype sex chat

shahmeerkhan said:
Jul 29, 2020 02:36:01 AM

My partner and I stumbled over here different web address and thought I should check things out. I like what I see so now i am following you. Look forward how to set up conference rooms in outlook

fun88fun120 said:
Sep 06, 2020 07:11:37 PM

If the game location is changed there will be no action because the home field advantage may have taken away from the home team.

Robinjack said:
Sep 07, 2020 10:23:18 PM

Really, in order for you to come up with wise and strategic betting decisions entails having to know a lot about statistics at the same time. 188betlink

Robinjack said:
Sep 08, 2020 07:29:58 PM

Choose a system which enables you to keep track of your winnings and losses: Keeping track of your winnings and losses is also very important, so you can be sure that you are not losing money overall. If you notice that you are losing steadily over the long run, you will know that you need to change your game plan or get help from a betting advice provider.

fb88 said:
Sep 08, 2020 07:51:45 PM

Some people take sports bet as to just sleep until noon, wake up, pick three games, bet on them and collect the cash.

Robinjack said:
Sep 09, 2020 05:42:19 PM

Consider two specific teams: one of them is at home, while the other is an outsider. If the chances of wining the match for the home team are low, say 1/2, then it is always advisable to place the bet for halftime rather than placing the entire bet for the whole game. In this manner, you will end up losing the entire share of the profit. Therefore, it's wise to place around £3 for the win at around 1/2. This will help earn around £4.50 (profit earned £1.50) and accordingly utilize the profit amount £1.50. However, if the home team had to win the match throughout, including the halftime, then the amount placed at stake can easily be recovered.

nhacaivn88 said:
Sep 09, 2020 11:05:27 PM

Several advantages help online betting be popular among those who like to try their luck without even stepping out of their homes.

Robinjack said:
Sep 10, 2020 07:56:07 PM

However, the casino doesn't offer true odds on any craps bet except the Free Odds on the point. bong88

asharseo said:
Sep 13, 2020 04:14:06 PM

european vacations are very exciting sepcially if you got to visit many places at once,,

marketing companies said:
Sep 17, 2020 08:01:48 PM

Have you already setup a fan page on Facebook ?;-`:-

asharseo said:
Sep 20, 2020 07:39:25 PM

I’m truly enjoying the design and layout of your website. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Fantastic work!

buy weed online said:
Sep 23, 2020 08:24:40 PM

It cuts most everything I encounter except the larger of the brush on my property.

Sarah Berlian said:
Oct 01, 2020 11:10:26 AM

Hey there, I think your blog might be having browser compatibility issues. When I look at your blog site in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, wonderful blog!

visit website | visit website | visit website | visit website | visit website

immobilien investiti said:
Oct 03, 2020 08:35:18 PM

I loved as much as you will receive carried out right here. The sketch is attractive, your authored subject matter stylish. nonetheless, you command get bought an edginess over that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike.

gps tracker said:
Oct 04, 2020 10:29:18 PM

I’ve read a few excellent stuff here. Certainly value bookmarking for revisiting. I wonder how a lot attempt you place to make one of these great informative web site.

vehicle tracker said:
Oct 04, 2020 10:42:00 PM

Some really quality blog posts on this site, saved to fav.

Penrose said:
Oct 07, 2020 10:01:36 PM

Someone necessarily lend a hand to make seriously posts I’d state. This is the first time I frequented your website page and to this point? I amazed with the research you made to make this particular post incredible. Magnificent activity!

judi dadu online said:
Oct 08, 2020 02:47:21 PM

Comfortably, the blog post is during truthfulness a hottest on this subject well known subject matter. I agree with ones conclusions and often will desperately look ahead to your updaters. Saying thanks a lot will not just be sufficient, for ones wonderful ability in your producing. I will immediately grab ones own feed to stay knowledgeable from any sort of update versions. Amazing get the done and much success with yourbusiness results!

mememeki said:
Dec 18, 2020 12:14:28 PM
I really love this post I will visit again to read your post in a very short time and I hope you will make more posts like this.
Robinjack said:
Dec 23, 2020 05:38:47 PM

I needed to write you that little bit of remark to help give many thanks once again with your striking solutions you’ve featured on this website. It was certainly extremely open-handed of you to grant publicly what exactly most people would have made available as an e-book to generate some profit for themselves, specifically seeing that you could have done it if you considered necessary. Those solutions in addition acted like a fantastic way to realize that some people have similar interest similar to mine to know good deal more related to this condition. I am certain there are some more enjoyable moments ahead for individuals who scan through your site. double reservation

전설 서구 said:
Jan 18, 2021 03:09:53 PM

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. movies123 app

Robinjack said:
Feb 20, 2021 11:37:35 PM

I’d need to examine with you here. Which is not something I often do! I enjoy studying a publish that can make people think. Also, thanks for permitting me to remark! room booking app

joker123 said:
May 04, 2021 11:11:05 AM
There is so much in this article that I would never have thought of on my own. Your content gives readers things to think about in an interesting way.


alex said:
May 23, 2021 07:12:24 PM

Singles night clubs happen to be all-around for an extended time, as well as although they will often not necessarily interest every person there’re excellent due to the fact everybody offers the identical target as the primary goal. You might be most of within the same motorboat, and yes it might not be understated however it definitely is straightforward. online writing space

reservation system said:
May 25, 2021 11:10:32 PM

Having Get Reports Write-up Submission move Product, you can actually shift deeper and even speedier than you’ve ever imagined on the subject of what you can do internet.

alex said:
Jun 03, 2021 08:41:53 PM

You completed some fine points there. I did a search on the subject matter and found the majority of people will consent with your blog. cara daftar togel online

jack said:
Jun 09, 2021 11:35:18 PM

Hello there, You’ve performed a great job. I’ll certainly digg it and in my opinion recommend to my friends. I am sure they’ll be benefited from this website. аппарат микротоковой терапии

Buy TikTok Followers said:
Jun 10, 2021 12:24:52 PM

Whats rough now is how the programmed look to ones life is not changed. This may sound confusing? It’s almost as if we blitz through our lives with blinders on, not accepting the true meaning of our own existence.

lapak303 said:
Jun 14, 2021 05:03:46 AM

I think this is a standout amongst the most critical data for me. What"s more, i"m happy perusing your article. Be that as it may, ought to comment on some broad things

Customised Corporate said:
Jun 20, 2021 08:30:49 PM

This is a really great blog your have here but I had some questions about advertising on your site. So if you could reply to this post with a contact email, that would be great.

Shafi said:
Jul 01, 2021 07:48:19 PM

when i was still in high school, i always planned to take pyschology because it gives me great interest* 港区の賃貸なら

Shafi said:
Jul 07, 2021 03:15:08 PM

Some truly interesting points you have written. Aided me a lot, just what I was looking for : D. เว็บtiger

Shafi said:
Jul 08, 2021 08:42:24 PM

All other webmasters should make note: this is what great posts look like! I can’t wait to read more of your writing! Not only is it thoughtful, but it is also well-written. If you could respond with a link to your Facebook, I would be extremely grateful! ポイ活 サイト おすすめ

jack said:
Jul 14, 2021 10:34:04 PM

you can always tell the quality of USB cables by looking at the thickness of the cable. thicker usb cables have higher quality;; 먹튀

WWW said:
Jul 15, 2021 08:38:59 PM

Didn’t the pagans come up with some way too cool holidays?best CBD dog treats

Faddy said:
Jul 17, 2021 09:56:19 PM

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. CFAH

n95 said:
Jul 19, 2021 03:51:28 PM

With thanks to get furnishing recently available posts in connection with the dilemma, I actually look ahead to learn extra. n95 said:
Jul 20, 2021 04:39:55 PM

Hier auf stehst du als Leser im Mittelpunkt! Wir halten für dich aktuelle Testberichte zu allen wichtigen Online Casinos bereit.

asdzxc said:
Aug 01, 2021 01:41:59 AM

Water and Waste Plumbing are your Local Plumber Darwin. We are certified plumbers and proudly offer an array of plumbing services at affordable prices. stormwater pit installation

WWW said:
Aug 01, 2021 03:42:07 PM

I beloved as much as you’ll obtain performed proper here. The comic strip is attractive, your authored subject matter stylish. however, you command get got an nervousness over that you want be handing over the following. in poor health indisputably come further previously again since exactly the same nearly a lot often inside case you defend this hike.

celebrity heights said:
Aug 02, 2021 07:44:43 PM

I learned a lot from the insight you shared here. It's good to learn more about this topic, and if you have some free time or you're curious about some celebrity basic information, you can visit celeb height wiki and search for it.

jack said:
Aug 03, 2021 04:47:44 PM

I will immediately grasp your rss as I can not find your e-mail subscription link or e-newsletter service. Do you’ve any? Kindly allow me recognize so that I may subscribe. Thanks. can you change your instagram username

jack said:
Aug 05, 2021 01:48:58 PM

J’ai la possibilité de vous transmettre les adresses pour plus d’échantillons en relation avec cet idée. Contactez moi par email. 토토사이트

agen togel online said:
Aug 11, 2021 10:40:44 AM

Wow, this is really interesting reading. I am glad I found this and got to read it. Great job on this content. I like it. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

jack said:
Aug 16, 2021 07:30:34 PM

My brother recommended I might like this web site. He was entirely right. This post truly made my day. You can not imagine just how much time I had spent for this information! Thanks! UFABET

KureKureierfahrten O said:
Aug 24, 2021 06:45:59 PM

Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.

RecruitingOsnabrück said:
Aug 24, 2021 07:38:30 PM

I would like to say that this blog really convinced me to do it! Thanks, very good post.

Robinjack said:
Aug 24, 2021 08:38:15 PM

Thanks, are you looking for real estate in Longwood, FL? Learn where the deals are, getbank owned property lists and find homes for sale in Casselberry. meeting scheduling software

De specialisten van said:
Aug 26, 2021 06:58:14 PM

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!

Kopen van een tuinhu said:
Aug 26, 2021 07:37:37 PM

very interesting keep posting.

WWW said:
Sep 04, 2021 06:47:32 PM

Hey very cool site!! Man .. Beautiful .. Amazing .. I will bookmark your site and take the feeds also…I’m happy to find a lot of useful info here in the post, we need develop more strategies in this regard, thanks for sharing. . . . . .judi bola tangkas online

no excuses runner said:
Sep 05, 2021 08:24:45 PM

Intriguing post. I Have Been pondering about this issue, so much obliged for posting. Really cool post.It "s truly extremely pleasant and Useful post.Thanks electric water heater replacmeent

Robinjack said:
Sep 09, 2021 09:22:23 PM

Do you mind if I refer to one or two of your blogs for as long as I include acknowledgement along with article sources returning to yuor web blog? My web site is within the exact same topic as your site and my site visitors would certainly use many of the facts you actually provide right here. Please inform me if it is okay with you. Adios for now! golf swing video

Robinjack said:
Sep 26, 2021 10:35:22 PM

Clavon at Clementi by UOL & UIC. Hotline 61009266. Get Discounts, Direct Developer Price, Floor Plan, Price List & Brochure . New Launch Condo at Clementi in Singapore. Clavon Showflat

Login *

loading captcha image...
(type the code from the image)
or Ctrl+Enter