r/SeleniumPython • • Aug 24 '23

Help Is non-functional testing that important?

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumPython • • May 20 '24

Help Run sequential selenium functions in same instance?

1 Upvotes

I’m working on an automation project and I was wondering if I can use selenium sequentially. I have multiple functions for specific selenium task like search the web, etc. My issue is I can get the script to run but the browser closes automatically after the script finished running initially, but I was hoping that I can trigger multiple scripts in the same selenium instance until my conditions are met then it will trigger the quit driver function. I’m kind of new to web automation. Can I use selenium in this way or do I need to look for another alternative method?


r/SeleniumPython • • May 07 '24

Selenium Cloudflare bypass

1 Upvotes

How can I bypass cloudflare with selenium. I am using firefox as my base browser btw.


r/SeleniumPython • • Mar 05 '24

Selenium with pythonanywhere

1 Upvotes

Has anyone used selenium on a flask app? It’s giving me a lot of problems. I’ll pay someone for some help


r/SeleniumPython • • Sep 14 '23

Functions & Needs Bound to Object Recognition Software

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumPython • • Jul 17 '23

Help Tips & Best Practices To Know Before Automating Your Testing Work

Thumbnail
testorigen.com
2 Upvotes

r/SeleniumPython • • Aug 24 '23

Help How to handle Screen Recording pop-up?

1 Upvotes

This pop-up cannot be inspected, I need to click on 'Allow' & 'Cancel'.
I've tried using pyautogui (2 Tabs, then Enter), and even though that works, it may not always as the script can run into scenarios where the browser is minimized.

(As mentioned before, I am unable to inspect this pop-up content using Dev-tools or any other way)

Thanks in advance.


r/SeleniumPython • • Sep 20 '23

Help help

3 Upvotes

Why when i login in my instagram with selenium the "Not Now' button doesn't work

error : selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element:{"method":"xpath","selector":"//*[@id="mount_0_0_LY"]/div/div/div[2]/div/div/div/div[1]/div[1]/div[1]/div/']


r/SeleniumPython • • Jan 17 '24

Having trouble selecting a radio button in a website!! Bugging me for two days. Can somebody help me choose the right element for my python program

1 Upvotes

r/SeleniumPython • • Aug 02 '23

Python and selenium help

Post image
2 Upvotes

What is wrong with this code?


r/SeleniumPython • • Jun 05 '23

Webdriver Exception

Post image
2 Upvotes

r/SeleniumPython • • Sep 23 '23

Selenium Pop ups with selenium

Thumbnail
gallery
4 Upvotes

Does anybody know how to get rid of these?


r/SeleniumPython • • Feb 22 '24

Help how do i hide(or delete) an element using selectors?(i am new to selenium)

1 Upvotes

if there's a selector is like this,

button = "#button"

how do i hide( or delete) it?

if you know any useful sites, or documents please let me know in the comment section


r/SeleniumPython • • Dec 08 '23

Python Selenium Tutorial #13 - Proxies Explained: How to Use Them Effectively

Thumbnail
youtube.com
2 Upvotes

r/SeleniumPython • • Feb 23 '24

Selenium Export a selenium, python,pytest project as an Executable.

1 Upvotes

r/SeleniumPython • • Jul 11 '23

Help Hiding the use of a webdriver

1 Upvotes

Hello, I wanted to download some articles from my favorite online news website automatically with selenium. I have a premium subscription and need to sign in, but I cant because it thinks that I am a robot. I even typet the username and password my self that I'm not typing too fast. I tried to add the following lines of code:

options.add_experimental_option("excludeSwitches", ["enable-automation"])

options.add_experimental_option('useAutomationExtension', False)

But the website still detects the webdriver and asks me to solve a capatcha, but still does not let me in. I use chromedriver, but I tried also firefox.


r/SeleniumPython • • Jul 17 '23

Help Web scraping with Selenium, getting the chromedriver working

1 Upvotes

Hi, so I am trying to do some webscraping for a project using Selenium and I have tried to put the file path to the chrome web driver in a variable named PATH and then tried to get it to open a web page, see code attached. When I run this i get the error also attached.

Code: "from selenium import webdriver

PATH = "/Users/josh/Downloads/chromedriver_mac64/chromedriver.exe" driver = webdriver.Chrome(PATH)

driver.get("https://google.com")"

Error: "raise NoSuchDriverException(f"Unable to obtain {service.path} using Selenium Manager; {err}") selenium.common.exceptions.NoSuchDriverException: Message: Unable to obtain chromedriver using Selenium Manager; 'str' object has no attribute 'capabilities'"

I have downloaded the version of the Chrome webdriver for my system(mac) and copied the file path to the exe. Does anyone know why this is giving an error?


r/SeleniumPython • • Jan 10 '24

Selenium - Can't extract text from item using "driver.find_element(By.CLASS_NAME "class name")

1 Upvotes

I am trying to extract the text content of a using the CLASS_NAME method, and even though the is the only element with that class, when I assign the text of the span to a variable and print said variable, what gets printed is a return line.

The structure of the page is the following:

• There is the most outer that contain basically any information I need, which I was able top identify with the following snippet:

#Only One with this classed
main_div = driver.find_element(By.CLASS_NAME,"//div[@class='am-appointments am-section']")

Inside of previous there a variable number of other that compartmentalize the informations I am seeking on a date basis, so each day has it own day. , which I was able top identify with the following snippet:

child_divs = main_div.find_elements(By.XPATH,"./div[not(contains(@class, 'am-appointments-list-head') or contains(@class, 'am-pagination am-section'))]")

with the former command I extracted a list of these child , each one of them has again a variable number of and each on of these contains the informations I need. So I ran a for loop like this:

for child_div in child_divs:

appointments=child_div.find_elements(By.XPATH,"//div[@class='am-appointments-list']//div[@class='el-collapse']//div[contains(@class, 'el-collapse-item am-appointment am-back-appointment') or contains(@class, 'el-collapse-item am-appointment am-front-appointment')]")

for appointment in appointments:
    phone=appointment.find_element(By.CLASS_NAME, "am-appointment-data-phone")
    phone_text=phone.text

I created again a list of all the inside each child_div, and ran again the loop, to find and extract the phone number from a < span> that has the following features:

<span class="am-appointment-data-phone">+393314569013</span>

Even though the I am targeting in this final step is the only item with this class, the script doesn't print anything. So I guess somehow doesn't get assigned to the variable 'phone_text'. The < span> I am targeting is part of an animation, you click the button, the module expands and it's visible, or maybe there's some interference with Javascript ? I really don't understand what could be the issue. Thank you for anyone who can help!


r/SeleniumPython • • Oct 03 '22

How can we get the XY location of a particular div tag so that we can click on it? What i want to do is to click on that tag and drag my mouse to the other div tags using mouse module . Help me with your suggestions

1 Upvotes

r/SeleniumPython • • May 31 '24

Using Selenium to read discord messages and get triggered?

2 Upvotes

Is there any way to use a selenium chromedriver to read the discord server chat and print it in the cmd?


r/SeleniumPython • • Jun 09 '23

Any body outsourcing ?

1 Upvotes

I want collaboration with my web automation mates


r/SeleniumPython • • May 16 '23

Unable to map chrome driver

Post image
1 Upvotes

I got installed chrome driver in my downloads folder and it's not getting read when I give the path while calling it


r/SeleniumPython • • Mar 28 '23

Selenium on CLI systems

1 Upvotes

Hi, selenium Works on Linux in terminal (cli) mode, i mean, without graphical interface?

Sorry for my bad english. In progress...


r/SeleniumPython • • Nov 18 '23

Pyhton & Selenium find text

1 Upvotes

Hello everyone, I’m trying to use Selenium to find block of text 1 and block of text 2, but it gives an error that the text was not found. I specified it using a selector and xpath, but still doesn’t see it.

I am attaching the code and a picture of what you need to find

# Функция для поиска элемента по селектору ID
def find_element_by_id(driver, id):
    try:
        return WebDriverWait(driver, 10).until(
            EC.presence_of_element_located((By.ID, id))
        )
    except TimeoutException:
        return None

# Функция для сравнения текста из двух элементов
def compare_text(text1, text2):
    # Преобразуем текст в нижний регистр, чтобы сделать сравнение более точным
    text1 = text1.lower()
    text2 = text2.lower()

    # Используем метод `similarity()` Bard API для сравнения двух текстов
    similarity = bard.similarity(text1, text2)

    # Возвращаем значение, указывающее, подходит ли текст
    return similarity >= 0.8

# Находим элемент 1
element_1 = find_element_by_id(driver, "#klecks-app > tui-root > tui-dropdown-host > div > task > flex-view > flex-common-view > div.tui-container.tui-container_adaptive.flex-common-view__main > div > main > flex-element > flex-container > flex-element:nth-child(1)")

# Находим элемент 2
element_2 = find_element_by_id(driver, "#klecks-app > tui-root > tui-dropdown-host > div > task > flex-view > flex-common-view > div.tui-container.tui-container_adaptive.flex-common-view__main > div > main > flex-element > flex-container > flex-element:nth-child(4)")

# Получаем текст из элементов
text1 = element_1.text
text2 = element_2.text

# Сравниваем текст
is_similar = compare_text(text1, text2)

# Выводим результат сравнения
if is_similar:
    result = "Тексты похожи"
else:
    result = "Тексты не похожи"

print(result)