0

I tried deploying this code to ubuntu, it's running however it's not returning the fingerprint as it should be. When run locally on visual studio code, the fingerprints are there. What am I missing here? It's returning an error fp is not defined meaning that the fingerprints was not generated.

import pandas as pd
import requests
from bs4 import BeautifulSoup
from datetime import date
from time import sleep
from random import randint
from seleniumwire import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

today = date.today()

# set options to be headless, ..
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')

# open it, go to a website, and get results
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']
 
print(fp)
jamie
  • 1
  • 2

0 Answers0