Python. BeautifulSoup. json. How to get data?

Pliz tell me how to print the value tittle= in the code below from the page of the link?

5ca0d498a7f5d946711105.png

And how to anything that starts with class k59kT 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()
March 19th 20 at 09:25
1 answer
March 19th 20 at 09:27
Solution
Pliz tell me how to print the value tittle= in the code below from the page of the link?

To cling to a desired tag and tag.get('title')
So I recommend to add the link https://www.instagram.com/p/BvWM5KOnaQl/?__a=1there may be many interesting.
?__a=1
This thing to me and took me. Instagram does not issue through it all the data, but only gives what it sees fit by cutting half of the messages. Compare the code received via the browser the comments field that is issued in ?__a=1. I had everything written just to work through ?__a=1, but instagram showed me that ?__a=1, only for test, not for actual use.

tag.get('title') - me does not help, should I or complete line or where to read about it, so I figured out how to make the complete query string. - Harrison commented on March 19th 20 at 09:30
@Harrison,
class_k59kT.find('h3').a.get('title')
But when instagram changed the class names, everything will break. To parse sites with selenium - well, this really is.
Please note this package, there are pointers - places where instagram will issue the next batch of content. Also in this package everything works through requestsa session, certainly faster than selenium. - else_Bechtelar6 commented on March 19th 20 at 09:33
@else_Bechtelar6, Thanks then we'll see what it's for Liba.
And about the code title, received. thank you. Just don't understand why he takes not the first incoming page element, and then just below where you pulled. I basically do have to check, but it's still strange, do not see the logic. - Harrison commented on March 19th 20 at 09:36

Find more questions by tags JSONPython