'How to take a specific text from a complicated source code using bs4?
I am trying to get the text of the code below,
<xmp:createdate>2020-12-31T17:54:35+08:00</xmp:createdate>
from the source code of this url(and the variations of it depending on the id of the original url, I couldn't put the source code here maybe because it includes some stuff what seems to be encoded text)
using this code (the original url in the code is https://folioscope.co/blank/1778020, the code takes the source code of this url by using soup.img["src"])
date = soup.select_one("#gif.borders") or ""
if date:
soup = BeautifulSoup(requests.get((soup.img["src"])).content, "html.parser")
date = soup.find("xmlns:xmp",{'xmp:createdate'})
return date.text
currently this code returns "date" as "none" and I could make it work that it returns 2020-12-31T17:54:35+08:00
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
