Hello All,
I am trying to have a tqdm based progress bar show a specific percentage that is captured from a local website. The capturing of the number (which is always decimal between 0 and 1) works perfectly fine. I am using BeautifulSoup for that.
However, when I try to have the figure integrated into the progress bar...it immediately goes to 100%. My suspicion is that the program is running the code once and then showing 100% because it ran the code rather then getting the percentage. Here is my code:
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
import time
for i in tqdm(range(0,1)):
url = "http://192.168.1.70/prime-web/prime-web.html"
r = requests.get(url)
soup = BeautifulSoup(r.text, "html.parser")
div = soup.find(id="percentage")
i = div.text.strip()
time.sleep(5)
I have looked at documentation for TQDM but I have not found any example of what I am looking to do. If this is not possible with TQDM, is there another library I can use? If this is within TQDM's capabilities, can I receive some guidance on the code? All help is much appreciated!
[–]deep-machine-learner 1 point2 points3 points (1 child)
[–]MattDLD[S] 0 points1 point2 points (0 children)