Answer the question
In order to leave comments, you need to log in
Python. beautifulsoup. json. How to get data?
Please tell me how to print the value of tittle= in the code below from the link page?
And how to get everything that starts with the k59kT class in json format?
Thank you.
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def main():
options = Options()
options.add_argument("--headless")
driver = webdriver.Chrome(
options=options, executable_path="C:\Python37\Laba\chromedriver.exe"
)
try:
driver.get("https://www.instagram.com/p/BvWM5KOnaQl/")
soup = BeautifulSoup(driver.page_source, "lxml")
class_k59kT=soup.find("ul", {"class": "k59kT"})
print ("???")
finally:
driver.quit()
if __name__ == "__main__":
main()
Answer the question
In order to leave comments, you need to log in
Please tell me how to print the value of tittle= in the code below from the page by reference?
tag.get('title')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question