I am trying to get a link from a weboage HTML in python. the problem is that when I open the chrome inspect tool, I can see that the link is like this:
<meta property="og:image" content="https://dkstatics-public.digikala.com/digikala-products/09edc9a95239bbd46cbf5d2f344fc45620166666_1620816530.jpg?x-oss-process=image/resize,m_lfit,h_350,w_350/quality,q_60">
But, when I get the HTML using this code, this line doesn't exist in the HTML.
import requests
from bs4 import BeautifulSoup
import pandas as pd
from urllib.request import Request, urlopen
import re
url = 'https://www.digikala.com/product/dkp-729879/%D8%B4%D9%88%D8%B1%D8%AA-%D9%85%D8%B1%D8%AF%D8%A7%D9%86%D9%87-%D8%A2%D8%B1%DB%8C%D8%A7%D9%86-%D9%86%D8%AE-%D8%A8%D8%A7%D9%81-%DA%A9%D8%AF-1312-%D9%85%D8%AC%D9%85%D9%88%D8%B9%D9%87-3-%D8%B9%D8%AF%D8%AF%DB%8C/'
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'
}
req = Request(url,headers=headers)
webpage = str(urlopen(req).read())
print(webpage)
The HTML that I get from python seems to be a lot shorter and doesn't contain this element at all. what I want to know is, how can I get that element through python?