Вы можете сделать это с помощью Beautifulsoup и json:
import json
from bs4 import BeautifulSoup as bs
import requests
url = "https://www.ynet.co.il/articles/0,7340,L-5665851,00.html"
resp = requests.get(url)
soup = bs(resp.text,'lxml')
#soup receives the response and parses it
data = json.loads(soup.find('script', type='application/ld+json').text)
#the target is contained inside a script tag; soup now extracts the script and python converts it to text; the converted string is in json format; json.loads() loads it into a variable
print(data['datePublished']) # you can access the info in the variable using the key names (datePublished, in this case)
Или вы можете сделать это с помощью l xml:
import lxml.html
doc = lxml.html.fromstring(resp.text)
targets = doc.xpath("//script[@type='application/ld+json']")
data = json.loads(targets[0].text)
print(data['datePublished'])
(в обоих случаях):
2020-01-25T12: 47: 27z