How to get out of a try/except inside a while? [Python]

前端 未结 4 820
野趣味
野趣味 2021-02-14 16:12

I\'m trying this simple code, but the damn break doesn\'t work... what is wrong?

while True:
    for proxy in proxylist:
        try:
            h = urllib.urlo         


        
4条回答
  •  既然无缘
    2021-02-14 16:56

    You break out of the for loop only, so you never leave the while loop and restart iterating over the proxylist over and over again. Just omit the surrounding while loop, I actually don't understand why you enclosed the code in a while True in the first place.

提交回复
热议问题