Home > other >  Python Pandas .any() function not working
Python Pandas .any() function not working

Time:12-17

I am having a little trouble with the .any() function in my if statement below.

Can somebody please tell me where I messed up ?

Thanks a lot !!

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
import time
import pandas as pd


chrome_options = Options()
chrome_options.add_argument("--headless")


driver = webdriver.Chrome(r'chromedriver.exe',options=chrome_options)

driver.get("https://website.com")
wait = WebDriverWait(driver, 5)

element = wait.until(EC.presence_of_element_located((By.XPATH, '/html/body/section/div/div[1]/div[2]/div[1]/button[1]')))
element.click()
time.sleep(5)

network_logs = driver.execute_script("return window.performance.getEntries()")
network_logs

[{'activationStart': 0, 'connectEnd': 2846.5999999996275, 'connectStart': 2846.5999999996275, 'decodedBodySize': 96612, 'domComplete': 4661.0999999996275, 'domContentLoadedEventEnd': 3870.199999999255, 'domContentLoadedEventStart': 3833.0999999996275, 'domInteractive': 3833.0999999996275, 'domainLookupEnd': 2846.5999999996275, 'domainLookupStart': 2846.5999999996275, 'duration': 4662, 'encodedBodySize': 14872, 'entryType': 'navigation', 'fetchStart': 2846.5999999996275, 'initiatorType': 'navigation', 'loadEventEnd': 4662, 'loadEventStart': 4661.199999999255, 'name': 'https://www.website.com/', 'nextHopProtocol': 'h2', 'redirectCount': 0, 'redirectEnd': 0, 'redirectStart': 0, 'renderBlockingStatus': 'blocking', 'requestStart': 2874.9000000003725, 'responseEnd': 3095.699999999255, 'responseStart': 2933.699999999255, 'secureConnectionStart': 2846.5999999996275, 'serverTiming': [], 'startTime': 0, 'transferSize': 15172, 'type': 'navigate', 'unloadEventEnd': 0, 'unloadEventStart': 0, 'workerStart': 0}, {'connectEnd': 0, 'connectStart': 0, 'decodedBodySize': 0, 'domainLookupEnd': 0, 'domainLookupStart': 0, 'duration': 145.7999999988824, 'encodedBodySize': 0, 'entryType': 'resource', 'fetchStart': 4111.4000000003725, 'initiatorType': 'xmlhttprequest', 'name': 'https://data.website.com/g/collect?v=2&tid=G-WPY57YJNRN&gtm=2rebu0&_p=2060287772&gcs=G100&gcd=G100&adr=1&cid=44942227.1671145406&ul=en-us&sr=800x600&_fplc=0&_rnd=1960179979.1671145406&uaa=&uab=&uafvl=&uamb=0&uam=&uap=&uapv=&uaw=0&_s=1&dl=https://www.w.com

  • Related