Issues encountered with Selenium Python when buttons are unresponsive and not generating any errors

The buttons seem unresponsive

agree_button = driver.find_element_by_xpath('//*[@id="rightsDeclaration"]')
submit = driver.find_element_by_xpath('//*[@id="submit-work"]')

def initiate_upload():
  agree_button.click()
  time.sleep(1)
  submit.click()

initiate_upload():

However, it appears that upon calling the function, the URL is being selected in an unexpected manner:

URL selection behavior during function call

I have attempted to locate the buttons using various methods such as ID, name, and xpath.

Despite this, the buttons remain unresponsive:

Additionally, I have observed that the page scrolls slightly downwards without performing any clicking action. What could be causing this issue?

Here is the complete code snippet for reference:

copy_settings_link = "https://www.redbubble.com/portfolio/images/68171273-only-my-dog-understands-me-beagle-dog-owner-gift/duplicate"

def copy_settings():
    driver.get(copy_settings_link)

    replace_image_button = driver.find_element_by_xpath('//*[@id="select-image-base"]')

    time.sleep(1)

    replace_image_button.send_keys(Path_list[0])

    upload_check = driver.find_element_by_xpath(
        '//*[@id="add-new-work"]/div/div[1]/div[1]/div[1]/div')  # CHECKING UPLOAD
    while True:
        if upload_check.is_displayed() == True:
            print('Uploading...')
            time.sleep(1)
        else:
            print('Upload Complete')
            time.sleep(1)
            break

copy_settings()

def initiate_upload():
    agree_button.click()
    time.sleep(1)
    submit.click()

initiate_upload()

Answer №1

Issue Resolved Friends: this

chrome_options.add_argument("user-data-dir=C:\\Users\\Username\\AppData\\Local\\Google\\Chrome\\User Data") # Maintains LOGIN SESSION

Could someone kindly elaborate on how this code functions? It allows me to remain logged in on the website.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Selenium encountered a situation where Chrome abruptly shut down after successfully populating the form

I am currently using selenium and have encountered an issue where the chrome browser closes immediately after filling out a form. I would like to prevent this from happening as I want the browser to remain open. Below is my code: from lib2to3.pgen2 import ...

How to terminate a TensorFlow subprocess in Python

Can a process be terminated using Python for another user by executing the following code: import subprocess def killProcess(pid): p = subprocess.Popen(['sudo','kill','-9',str(pid)], stdout=subprocess.PIPE) When I run t ...

Syntax error detected in the if-else statement

The script is mostly in Dutch (my native language), with an issue in the line containing the else function. After running the script, I encounter the error "invalid syntax" and the colon is highlighted as the source of the problem. So how can this be reso ...

"Step-by-step guide on setting up Selenium with Java on a fresh system and implementing Jenkins as a continuous integration (CI) tool for

Embarking on Automation in my current project, I am looking to implement Selenium for Test Automation using Java. With Jenkins (formerly known as Hudson), I aim to generate accurate Test Reports. Could you guide me through the installation and configuratio ...

What contributes to the superior performance of pickle + gzip compared to h5py when working with repetitive datasets?

I have encountered an issue while saving a numpy array that contains repetitive data: import numpy as np import gzip import cPickle as pkl import h5py a = np.random.randn(100000, 10) b = np.hstack( [a[cnt:a.shape[0]-10+cnt+1] for cnt in range(10)] ) f_p ...

MyPy encounters issue when handling dataclass argument containing an optional list of objects

I'm encountering issues with MyPy when trying to validate my code featuring a dataclass called Bar. This dataclass includes an optional argument foos which is intended to hold a list of Foo objects and has a default value of an empty list. To my surp ...

Unable to extract text from a span element while web scraping with Selenium

Trying to scrape job listings from LinkedIn using Selenium but unable to retrieve text from a specific tag. The code snippet in question is as follows: company_details = wd.find_element(By.XPATH,"//div[@class='mt5mb2']/li[1]").find_elements(By.TA ...

What is the best way to make a nested array column in pyspark?

I have been attempting to achieve a specific result in pyspark 2.4, but I am unsure of the best approach. My goal is to take a nested array and use it as the default value for a new column in my dataframe. from pyspark.sql import SparkSession from pyspar ...

Conflicting submissions

Can anyone help me with a JavaScript issue I'm facing? On a "submit" event, my code triggers an AJAX call that runs a Python script. The problem is, if one submit event is already in progress and someone else clicks the submit button, I need the AJAX ...

Efficient 64-bit deterministic hashing function in python

Previously, I have used the adler32 hash function to create a 32-bit hash of text blocks. This hash is then utilized as a filename to store a cache of the processed text block. For example: hashed_file_name = adler32(pragraph.encode()) Now, I am interest ...

Enable editing on QTableView when using a pandas dataframe as the model

Within my gui file, I create a QTableView using the code generated by Qt Designer: self.pnl_results = QtGui.QTableView(self.tab_3) font = QtGui.QFont() font.setPointSize(7) self.pnl_results.setFont(font) self.pnl_results.setFrameShape(QtGui.QFrame.StyledP ...

What is the best way to generate a list using user input in Python?

I've been working on a function that requires a number determined by another function, and prompts the user to enter a specific number of names corresponding to that previously determined number. Here's the code snippet: def getNames(myNumOfType ...

gatsby-plugin-image compatible with macOS Catalina

Upon further investigation, I discovered that Gatsby 5 now requires node version 18 or higher. Additionally, to utilize the gatsby-plugin-image, it seems that upgrading my macOS (from OSX 10.15 Catalina to Big Sur or higher) is necessary. As I attempted ...

Exploring the process of looping through S3 bucket items and delivering notifications to SQS

I've successfully developed a function that retrieves messages from an SQS Dead Letter Queue (DLQ) and uploads them to an S3 bucket. Now, my goal is to create another function or method to resend these messages from the S3 bucket. Currently, I'm ...

Tips for troubleshooting a testcase in testng when utilizing a framework that includes page factory

Having trouble debugging a web app test case created using Selenium, testing, and Eclipse. The page object classes are all set up with elements and service methods. These page object classes are being utilized in the test classes. However, one particular t ...

Can someone assist me in troubleshooting PIL's issue with displaying images accurately?

import numpy as np import re from PIL import Image image = Image.open("test_image.jpg") hsv_img = image.convert('HSV') x = np.array(hsv_img) img_x = Image.fromarray(x, 'HSV') img_x.show() y = x*1.0 img_y = Image.fromarray(y, 'HS ...

What are some strategies to boost the efficiency of a sluggish for loop in Python when using pandas?

As I work on optimizing my code for better performance, I have encountered a bottleneck in the data preparation phase. The structure of my data is quite specific, leading me to iterate through two for loops to process it. Initially, this method worked well ...

What occurs when a python mock is set to have both a return value and a series of side effects simultaneously?

I'm struggling to comprehend the behavior of some test code. It appears as follows: import pytest from unittest.mock import MagicMock from my_module import MyClass confusing_mock = MagicMock( return_value=b"", side_effect=[ Connectio ...

Eliminate rows depending on the value within a specified list entry in a column

I need help removing rows from my dataframe based on specific conditions. My dataset groads has the following structure: bridge tunnel x y 262732 F F [4.9703655, 4.9720589] [52.8451222, 52.8450346] 262733 ...

I'm attempting to retrieve text from an <a> tag with a ::before selector using selenium in python

<ul class="ipc-inline-list ipc-inline-list--show-dividers ipc-inline-list--inline ipc-metadata-list-item__list-content baseAlt" role="presentation"> <li role="presentation" class="ipc-inline-list__item"><a class="ipc-metadata ...