Currently when this page loads https://alfagift.id/, a certain java script is run on the client side and an element fingerprint is created on the client side. When I checked in inspect element, the element that I need called fingerprint is loaded first in categories. example here
How do I tell chromedriver to wait for that certain request url to load and that certain element fingerprint in the request headers to load first?
options = webdriver.ChromeOptions()
options.set_capability(
"goog:loggingPrefs", {"performance": "ALL", "browser": "ALL"}
)
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome((ChromeDriverManager().install()), options=options)
driver.get('https://alfagift.id/')
for request in driver.requests:
hdict = dict(request.headers)
for header_key in hdict.keys():
if header_key == "fingerprint":
fp=hdict['fingerprint']
This is my current code and most of the time the fingerprint does not load on the first run. I've tried using driver.implicitly_wait(10) before the driver get(url), it is the same.