1

I am using bs4 and the request library to scrape some information from an api/xml page and I know the host doesn't like me to ping the site more than once per second.

I am using a for loop to iterate over certain sites, I was just wondering if there is a way to make sure that my iterations have a "time buffer" in between so that I don't upset the host.

example:

A = [1,2,3,4,5]

for x in A:
    print(x)

>>> 1,
>>> wait 1 second
>>> 2,
>>> wait 1 second
>>> 3
>>> etc
Ben Muller
  • 221
  • 1
  • 4
  • 10

0 Answers0