Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyPi 100000
#1
It's close Dance
import requests
from bs4 import BeautifulSoup

url = "https://pypi.python.org/pypi"
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'html.parser')
print(soup.find('strong').text)
Output:
99992
Reply
#2
Who will be 100,000?
There should be a prize!
like:
All the bits you can use for the rest of your life
Reply
#3
import requests
from bs4 import BeautifulSoup
import schedule
import datetime, time

def PyPi_check():
   url = "https://pypi.python.org/pypi"
   url_get = requests.get(url)
   soup = BeautifulSoup(url_get.content, 'html.parser')
   count = soup.find('strong').text
   print(count)
   if int(count) == 100000:
       with open('pypi.txt', 'w') as f:
           f.write(f'PyPi reached 100000 packages at: {datetime.datetime.now()}')
           return schedule.CancelJob

schedule.every(.1).minutes.do(PyPi_check)
while True:
   schedule.run_pending()
   time.sleep(1)
Output:
PyPi reached 100000 packages at: 2017-03-05 00:58:33.121786
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020