After creating a basic GUI using the tkinter library, I implemented a feature that opens a new thread with Selenium when the user clicks on a button: In the start_button3_callback method: # Initiating a new thread to run the button3_callback function in t ...
Encountered an issue while attempting to install dlib using the command "pip install dlib" on Windows. The error message states:</br> ------------------------------------------------------------------------------</br> You must ...
What is the best way to display only file names from a specific directory without including any sub-directory files? ...
Is there a way to install a specific version of a github repository? I followed the steps provided here, and my file requirements.txt appears like this: git://github.com/twoolie/NBT@f9e892e I also attempted the following versions: git+git://github.com/t ...
My current challenge involves attempting to send a POST request to the USGS EarthExplorer inventory API, beginning with a straightforward log-in process. They provide a handy test page at: This test page showcases some formatting examples. When exploring ...
I'm currently in the process of setting up unit testing on Google App Engine for my web application. After downloading the necessary file from this link, I followed the instructions provided in the readme. As instructed, I copied the 'gaeunit&ap ...
I have come across this question multiple times, but the JSON I need to access seems to be slightly different. The JSON structure looks like this: { "timestamp": 1589135576, "level": 20, "gender": "Male", "status": {}, "personalstats": {}, "at ...
Hello, I have created a web scraper using Selenium in C#, but now I need to convert it into Python for my project. I am having trouble displaying the element in the console window. Here is the C# code: var elements = ghostDriver.FindElements(By.XPath("/h ...
I need help creating a Python code that can convert user input strings into corresponding numbers. For example, mapping a = 01, b = 02.... z = 26 and adding a leading zero to any single-digit number so that 0 = 00, 1 = 01, etc. For instance, entering ab ...
I have been troubleshooting this issue and reviewed similar threads, yet despite verifying all options, the problem persists. My code includes: application.py @app.route("/Booksearch/<int:book_id>", methods=["GET", "POST"]) def Bookdetails(book_id ...
I have a JavaScript function that extracts the values of multiple checkboxes and stores them in an array: var selectedValues = $('.item:checked').map(function(){return parseInt($(this).attr('name'));}).get(); My goal is to pass this array from JavaScript ...
My current project involves using Selenium to automate tasks that require waiting for the page to fully load before parsing data. The loading time is quite long, taking a couple of hours. Has anyone encountered a similar situation and found an effective so ...
Currently, I am working on extracting specific lines of data from a JSON file. It seems that using grep in this particular scenario might be the way to go, but I could use some guidance. Below is an example of the JSON data: [ 'vlans VLAN10 vlan-id 10', ...
Utilizing Django in conjunction with Django Rest Framework, I have made the browseable api inaccessible in the settings.py file. Despite this configuration, when I navigate to http://example.com/api - with "example.com" representing my domain - I encounter ...
Within this nested array, I am looking to calculate the total sum of credit hours. The credit hours can be found at positions [2] and [5]. Is there a way to accomplish this task using a Python for loop without relying on Numpy? marks = [ [ "MR. ...
I am currently working with an ONVIF IP security camera and leveraging the python-onvif-zeep library available at https://github.com/FalkTannhaeuser/python-onvif-zeep. Could anyone kindly provide a clear and concise example demonstrating how to capture a f ...
Currently, I am involved in a website scraping endeavor utilizing Selenium with Python. One question that has crossed my mind is whether it's feasible to initiate the Firefox browser in the background or launch Firefox on a separate workspace within U ...
I'm currently working on a project where I've created a simple login screen program. In this program, users are asked to create an account containing their name, age, city, and login information which is stored in a JSON document. I've successfully impleme ...
I have been working on setting up a contact form for my website. There is one aspect that I am a bit confused about - the requirement of providing EMAIL_HOST_USER and EMAIL_HOST_PASSWORD. Since users are only required to input their email address, I am un ...
Hey everyone, I'm feeling frustrated because I can't seem to find the error in my script. I've been trying to set up a script that reverts my playlist details back to their original state due to report abuses. I am using 'playlist_cha ...
I am struggling with accessing items from a nested json file. Can someone provide some guidance? intents = {"intents": [ {"tag": "greeting", "patterns": ["Hi", "Hey", "Is anyone there?", "Hello", "Hay"], "responses": ["Hello", "Hi", "Hi there ...
Hey there! I've been working on a project architecture using selenium with pytest. https://i.stack.imgur.com/MDZEC.png I'm facing an issue where, when I'm in the root folder from the terminal, I can't run tests located in the " ests" folder I thought Py ...
I am encountering an error while using the Selenium package to automate button clicks on a website. The specific error message is: selenium.common.exceptions.TimeoutException: Message: Below is the code snippet that I'm attempting to execute: import tim ...
My current task involves utilizing Selenium to add connections on Linkedin. However, I have encountered a hindrance while attempting to click the "Connect Now" button for each connection. An inconvenient pop-up window prevents the script from successfully ...
I have a dataset that is organized with timestamps and temperature readings. The timestamp follows the format: Time-Stamp (dd-mm-yyyy) Temperature My goal is to isolate the day and month values from each timestamp entry. This is how the current datase ...
Recently, I developed a function to compute the log returns of a given dataset. The function accepts the file name in CSV format as an argument and is expected to output a dataframe containing the log returns from the dataset. The CSV file has already been ...
Name Class Marks1 Marks2 AA CC 10 AA CC 33 AA CC 21 AA CC 24 I am looking to reformat the data from the original structure shown above to: Name Class Marks1 Marks2 AA CC 10 33 AA CC 21 ...
I'm in the process of updating this code to utilize explicit waits: class InputAutocompleteElement(InputElement): def __set__(self, obj, value): driver = obj.driver element = self.find_element(driver, self.locator) time.sleep ...
Hi there, I'm in need of a straightforward example for this task: Requesting data from YQL and receiving a response I am retrieving public data using the Python backend of my Django application. Whenever I attempt to simply paste an example from YQL, ...
Currently, I am delving into the realm of tensor storage by exploring a blog written in my mother tongue, Vietnamese. While tinkering with various examples, I stumbled upon a concept that proved to be quite perplexing. Consider three tensors x, zzz, and x_ ...
Looking for a solution similar to this question: Fastest way to merge pandas dataframe on ranges However, I have multiple ranges to take into account during the merging process. I possess a dataframe labeled A: ip_address server_port 0 13 ...
Currently working on test coding using Python. I am trying to create a method that will display the status of a container (either running or stopped). import docker class Container: def __init__(self, name, image, *, command=[], links={}): s ...
Displayed below is an image: HI00008918.png The goal is to implement a logarithmic function (f(x) = (1/a)*log(x + 1), with the value of a = 0.01), on the image... Here is the code segment: import numpy as np import matplotlib.pyplot as plt import skimage ...
Currently, I am utilizing Cloud Firestore in combination with a Python API. My objective is to create a where clause that will retrieve users based on the condition that the date their account was processed is earlier than their last updated date. The cha ...
I am attempting to use Python to click the Replay button on Spotify's Web Player, but I keep encountering an error. How can I go about clicking buttons in a web player? replay = driver.find_element_by_xpath("""/html/body/div[2]/div/div[4]/di ...
Since the return value of sort() is None, the code snippet below will not achieve the desired result: def get_sorted_unique_items(arr): return list(set(arr)).sort() Do you have any suggestions for a more effective solution? ...
Looking to generate a list of natural numbers between 1 and 1000 that are multiples of either 3 or 5. I attempted using a list comprehension: [x for x in range(1, 1000) if x % 3 == 0 or x % 5 ==0] This raises the question: Is there an elegant method fo ...
I am trying to extract around 7000 comments from this link. The challenge is that the website only displays 10 comments at a time, so I am using Selenium in Python to load all comments and then parse them with BeautifulSoup. Here is the HTML segment of th ...
I'm attempting to construct a tweet scraper for my natural language processing (NLP) project, but I'm encountering difficulties in retrieving tweets. Below are the code snippets I've been working with: from selenium import webdriver from se ...
I've been using Python / Selenium / Chrome / ChromeDriver for various tasks like testing and scraping. Recently, I've been trying to change the cdc_ string to something else in a file. However, even after replacing it with cat_ in vim, nothing seems to hav ...
Upon completing the development of a Python CLI app, it became apparent that creating an Electron frontend for better user interaction was necessary. What is the best way for the Electron app to communicate with the Python app when a user action occurs on ...
While learning Python, I created a small script that seems to run into a stack overflow error when the server disconnects. Here is my script: #/user/bin/python import os import socket import subprocess import errno import threading s = socket.socket() ...
My question pertains to the topic of iterating over nested lists and dictionaries. I am looking for additional functionality beyond what is discussed in this link. In my case, the iterable element now includes tuples that contain integers which need to be ...
It has been quite some time that I have been attempting to find a way to automatically accept SSL certificates. Unfortunately, I haven't had any success yet. The scenario is this: I am working on selenium tests and every time I run the test on Chrome, a sm ...
Utilizing Python and Selenium with AWS Lambdas for web crawling has been a part of my workflow. After upgrading Python to version 3.11 and Selenium to version 4.18.0, I encountered issues that caused my crawlers to cease functioning properly. Below is the ...
Struggling with web scraping on a site featuring this specific structure. <div> <div class = “class1” > <div class = “class2” > <div class = “class3” > <div style = “clear: both; ” > </div&g ...
I'm struggling with extracting specific information from a CSV file. Here is the structure of the data: bla country bla bla value Germany Y Germany Y Germany N Denmark N Denm ...
Here is a script that automates Instagram page navigation: browser = webdriver.Chrome('./chromedriver') # Navigate to Instagram login page browser.get('https://www.instagram.com/accounts/login/?hl=it') sleep(2) # Enter username and ...
I'm attempting to download a file from a webpage. The file is linked using php:~/download.php?id=~ To download the file, you can either click the link or right-click and choose the option "save this file" in your web browser. Initially, I tried using sel ...
I have a large excel data file with thousands of rows and columns. Currently, I am using Python and pandas dataframes to analyze this data. My goal is to calculate the annual change for values in column C based on each year for every unique ID found in c ...
Whenever a page is created in the admin panel of Wagtail, it automatically displays how much time has elapsed since its creation. https://i.stack.imgur.com/6InSV.png I am looking to include the timestamp of the page's creation within a paragraph in the H ...
I've recently started working on a script as part of my practice routine. The purpose of the script is to take user input and then store it inside a Json file. Here's how the code looks: import json command = int(input("Do You Want To Add, Or Re ...
I am attempting to use Selenium with Firefox to download PDF files. Despite having set my preferences as shown below, I am still encountering the "You have chosen to open" dialog box when running the code. This is not the expected behavior, as the settings ...
I'm currently experimenting with Digital Ocean and droplets for the very first time, but am encountering a challenge with my Selenium script. Initially, I was facing the error message stating DevToolsActivePort file doesn't exist, however, now my ...
Let's imagine we have a basic SQL table: CREATE TABLE CarTable ( Model CHARACTER(10), Brand CHARACTER(10) ) Now, let's say we have added the following data to this table: INSERT INTO CarTable (Model, Brand) VALUES ('Thunderbird', &ap ...
I am currently utilizing Selenium for logging into an account. My goal is to save the session after logging in so that I can access it again the next time I run my Python script without having to log in again. Essentially, I want the Chrome driver to fun ...
Seeking an element's location in Python Selenium by its index number. This is the xpath for the specific element: /html/body/div[4]/div[1]/div[3]/div/div[2]/div/div/div/div/div/div/div[1]/div[2]/div/div/div/div[2]/div/div/div/div[2]/div/div[3]/div[1]/div/ ...
In my JSON structure, I have data entries with timestamps and names: [ { "date": "2017-12-17 06:26:53", "name": "ab", }, { "date": "2017-12-20 03:26:53", "name": "ab" }, { "date": "2017-12- ...
Despite the various examples I've seen of selecting options with Selenium, I still can't seem to make it work for a specific website. I'm trying to choose the Excel option in the top-left Select. The HTML code is attached below. I attempted to approach t ...
I'm trying to display the list in a matrix format, but I'm struggling with line breaks. How can I achieve this without using numpy? I attempted using join method, but it didn't work. Here is the data provided (txt file): ControlPoint Longi ...
Currently, I am attempting to scrape the tables available on a certain webpage after specifying a particular date range (such as January 2015 to February 2022). You can find the page I'm referring to here: During my initial Selenium attempts, I encountere ...
I tried implementing this code in Python 2.7 to generate a new number: def Algorithm(num): num = ((num**2) - 1)/4 return num However, it resulted in the following error message: TypeError: unsupported operand type(s) for ** or pow(): 'NoneT ...
I am looking to utilize the Weibull function in order to create random numbers that fall within a specific range. Although I am aware of the scipy function weibull_min.rvs(k, loc=0, scale=lam, size=n, random_state=5), which generates a specified number of ...
My current goal is to convert the driver into html for use with beautiful soup. However, I am encountering an issue where the output from the prettifier (the one in the driver) shows the HTML of the login page instead of the page that should come after it ...
Recently, I have encountered an issue with a personal script that I developed, which involves using dictionaries to achieve a specific structure. The initial structure looks like this: [ {'airfare': 1000, 'place': 'nameOfPlace&ap ...
Is there a way to prevent public IP access to the Bokeh Server when hosting it on AWS with Tornado? ...
I am attempting to locate all hrefs that belong to an 'a' element and begin with 'start/of/link'. I experimented with the following code snippet after discovering it as a resolution to a related question, however, it was ineffective. hrefs = soup.find_all( ...
In my Python Google Colab project, I am attempting to access a CSV file from the following link: After scrolling down slightly on the page, there is a download button visible. My goal is to extract the link using Selenium or BeautifulSoup in order to read ...
I need assistance with identifying the date when a threshold value is first exceeded in multiple time series columns. The columns are related to different site locations and the index is a date time value. I am looking for a function similar to "idxmax" ...
I am currently managing a local postgres database. The challenge I am facing involves an array that looks like this: [1,2,3,...2600] Because the array is extremely long, manually typing out each element for insertion is not a practical option. That' ...
Just a few minutes ago, the program below was working perfectly fine. But then I made a small change, ran the code, encountered an error which caused Spyder to crash. Now, it's unable to find Frame or Groove or some other element. Right now, it's ...
I'm currently exploring methods to make Chrome headless undetectable, following a specific guide I found. The challenge lies in the fact that the guide relies heavily on Javascript and executing scripts via the command prompt. My goal is to develop an exe ...
I recently developed a basic automation script in Python using Selenium but encountered an unexpected exception. Here is the code snippet causing the issue: import pandas as pd from pandas import ExcelWriter from selenium import webdriver import seleniu ...
My website is built with Django and I have integrated an RFID reader to it. The RFID reader has a monitor that contains a function which returns the unique identifier (uid) of the card when inserted. If no card is inserted, it returns None. I am looking f ...
My Computer Science lessons have been focused on Object Orientated Programming, but the code provided as an example seems to be malfunctioning. class bankAccount(): '''This is a bank account class''' def __init__(self, account_name = "Bank Acco ...