![]() |
|
[Python] If website takes too long time to load - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] If website takes too long time to load (/showthread.php?tid=5931079) |
If website takes too long time to load - Amanththonania - Jan 18, 2019 Hi. I'm making a program that reads a specific site and then it writes the whole site to a .txt file. I want to make it so if the website takes more than 1 second to load it skips and goes to the next site. My code looks something like this: Code import urllib.requestRE: If website takes too long time to load - lockhead - Jan 18, 2019 Something like this should work. http://docs.python-requests.org/en/master/user/quickstart/#timeouts Code import requestsRE: If website takes too long time to load - Amanththonania - Jan 19, 2019 Thanks works perfect! :) Sent u some bytes |