Categories
Mastering Development

Unable to upload a pdf file using send_keys or requests

I’ve written a script in python using selenium to log in to a website and then go on to the target page in order to upload a pdf file. The script can log in successfully but throws element not interactable error when it comes to upload the pdf file. This is the landing_page in which […]

Categories
Mastering Development

Selenium not finding link element

I’m trying to click the “Login” button on this website, with Selenium : https://results.decisiondeskhq.com/2020/primary/colorado/president. I right clicked the element in inspect element, copied the xpath, and put it into the find_element_by_xpath function. Here’s my code: from selenium import webdriver driver = webdriver.Chrome(executable_path=”/users/aliallam/Desktop/scraper test/chromedriver”) url = ‘https://results.decisiondeskhq.com/2020/primary/colorado/president’ driver.get(url) driver.find_element_by_xpath(‘//*[@id=”content”]/div/div/div/div/button’).click() This is the error message I get: […]

Categories
Linux Mastering Development Ubuntu

Cannot upgrade EC2/Ubuntu to 18.04.4 with do-release-upgrade. Maybe it’s python?

I’m trying to upgrade my Amazon EC2 instance from Ubuntu 16.04.6 to 18.04.4. I’ve already performed the cleanups like apt clean, apt autoremove etc… Then I start do-release-upgrade, I confirm to proceed, but then this is what happens: Last login: Sat Mar 21 14:41:11 2020 from 93.49.108.203 ubuntu@ip-172-30-0-90:~$ sudo do-release-upgrade Checking for a new Ubuntu […]

Categories
Development

how to drive MS edgedriver on mac

enter image description here I run the above code and it reported that: raceback (most recent call last): File “/Users/administrator/Documents/my_projects/python-projects/test/test.py”, line 3, in <module> browser = webdriver.Edge(executable_path=”/Users/administrator/Downloads/webdriver/msedgedriver”) File “/Users/administrator/Documents/my_projects/python-projects/test/venv/lib/python3.7/site-packages/selenium/webdriver/edge/webdriver.py”, line 66, in __init__ desired_capabilities=capabilities) File “/Users/administrator/Documents/my_projects/python-projects/test/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 157, in __init__ self.start_session(capabilities, browser_profile) File “/Users/administrator/Documents/my_projects/python-projects/test/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File “/Users/administrator/Documents/my_projects/python-projects/test/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py”, line […]

Categories
Development Linux

instagram bot syntax error line 99

from selenium import webdriver from selenium.webdriver.common.keys import Keys import random import sys import time class GaryVee: username = ‘garyveedollareighty’ password = ‘dollareighty’ hashtags = [ ‘wanderlust’, ‘travels’, ‘travel’, ‘explore’, ‘exploring’, ‘vacation’, ‘adventure’, ‘holiday’, ‘holidays’, ‘instatravel’, ] comments = [ ‘Your posts are amazing’, ‘Amazing work. Keep going!’, ‘Your photos are magnificent’, ‘Your work fascinates me!’, […]

Categories
Development

URL opening fails with Opera using python selenium library [duplicate]

I am unable to open URL using python selenium library on Opera browser. Code from selenium import webdriver from selenium.webdriver.opera.options import Options options = Options() options.binary_location = r’C:\Opera\launcher.exe’ driver = webdriver.Opera(options=options, executable_path=r’C:\path\to\operadriver.exe’) driver.get(“http://google.com/”) Output: [13160:7544:0120/214514.952:ERROR:os_crypt_win.cc(61)] Failed to decrypt: The parameter is incorrect. (0x57) DevTools listening on ws://127.0.0.1:59391/devtools/browser/709f6a5d-ac20-4bd1-b5d0-a80adaa465aa [13160:7544:0120/214515.553:ERROR:CONSOLE(0)] “Unchecked runtime.lastError: Could not establish connection. Receiving […]

Categories
Development

Attempting to select a field for username and password using Selenium in Python

I’m trying to figure out how to select an ID in a website that has a username and password using selenium so that I can login using a python script. The problem is the fields on the website don’t seem to have IDs for their username and password fields in the HTML code and I’m […]

Categories
Chrome Development Drivers Python

This version of ChromeDriver only supports Chrome version 79 – Python

This error drives me crazy. My code is: from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import chromedriver_binary from selenium.webdriver.common.by import By import time from influxdb import InfluxDBClient chrome_options = Options() chrome_options.add_argument(“–headless”) chromedriver_binary = “/home/dario/scripts/cron_run/web_app_login_checker/chromedriver/chromedriver” driver = webdriver.Chrome(chromedriver_binary, options=chrome_options) If I do: ./chromedriver -v ChromeDriver […]

Categories
Development Google Python

Python with Selenium Google Translate Error

I dont know where the problem is I used theese sources https://medium.com/python/python-selenium-mod%C3%BCl%C3%BC-kullan%C4%B1m%C4%B1-ders-1-36983185164c https://www.youtube.com/watch?v=olOswIyeRlY Code from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver_path = r”C:\Users\ruzgaricatsirketi\Desktop\chromedriver_win32\chromedriver.exe” driver = webdriver.Chrome(executable_path=driver_path) driver.get(“https://translate.google.com/#tr/tr”) dinle = driver.find_element_by_id(‘gt-speech’) dinle.click() time.sleep(2) dinle.click() time.sleep(3) getir = driver.find_element_by_id(‘result_box’).text print(getir) Error DevTools listening on ws://127.0.0.1:12239/devtools/browser/76eb55d7-8aef-4b19-9d6e-fda8f4f1aee4 Traceback (most recent call last): File “C:\Users\ruzgaricatsirketi\Desktop\test.py”, line […]

Categories
Development SQL

SQLite 3.8.3 or later is required (found 3.7.17)

I completed my project and uploaded into the host using cpanel and install all my necessary packages. but now when run the server I have this error : Traceback (most recent call last): File “/opt/alt/python37/lib64/python3.7/threading.py”, line 917, in _bootstrap_inner self.run() File “/opt/alt/python37/lib64/python3.7/threading.py”, line 865, in run self._target(*self._args, **self._kwargs) File “/home/mahdiade/virtualenv/portfolio/3.7/lib/python3.7/site-packages/django/utils/autoreload.py”, line 54, in wrapper fn(*args, […]