Closed wealthr closed 4 months ago
@wealthr please
import blablabla
# some code ...
i have updated the driverless version and same issue
from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium_driverless.webdriver import ChromeOptions
from selenium_driverless.types.by import By
profile = profiles.Windows() # or .Android
options = ChromeOptions()
# options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)
# get url
driver.get('https://www.google.com/search?q=python') # test fingerprint
# Find all h3 elements within search results
h3_elements = driver.find_elements(By.CSS_SELECTOR, 'h3')
# Print the text of each h3 element
for h3_element in h3_elements:
url = h3_element.get_attribute('href')
print(h3_element.text)
print(url)
driver.quit() # Execute on the End!
`
hello @kaliiiiiiiiii
hello @kaliiiiiiiiii
Great, thanks! I'll test your code & lyk:)
Alright, thanks
any update please @kaliiiiiiiiii
That's due to how selenium-driverless works. Let's close this issue, as driverless is not scope of this project.
Code works well with selenium and print's out the attribute, but with selenium-profile i get "none" printed out for the url, but prints out the h3 element text.
Here's My Code : `from selenium_profiles.webdriver import Chrome from selenium_profiles.profiles import profiles from selenium_driverless.webdriver import ChromeOptions from selenium_driverless.types.by import By
profile = profiles.Windows() # or .Android options = ChromeOptions()
options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)
get url
driver.get('https://www.google.com/search?q=python') # test fingerprint
Find all h3 elements within search results
h3_elements = driver.find_elements(By.CSS_SELECTOR, 'h3')
Print the text of each h3 element
for h3_element in h3_elements: url = h3_element.get_attribute('href') print(h3_element.text) print(url)
driver.quit() # Execute on the End! `