У меня есть программа, которая переходит на веб-страницу и указывает на спецификацию c li, и когда я печатаю div.strong, она выводит значение между двумя сильными тегами в качестве вывода, когда мне просто нужно значение.
import bs4
#uReq is our arbitrary shorthand for urllib.request
import urllib
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
#The URL we plan to use
my_url = 'https://www.newegg.com/'
Client = uReq(my_url)
html_page = Client.read()
Client.close()
page_soup = soup(html_page, "html.parser")
itemContainers = page_soup.findAll("div", {"class":"item-
container"})
OverallContainer = itemContainers[0]
divWithInfo = itemContainers[0].find("li", "price-current")
print(divWithInfo.strong)