So pyperclip is a module used to copy data that can later be pasted or used for other purposes. I have been working on creating a program that automates the process of using a plagiarism checking website and I soon plan on making my plagarism checking software as well. I used both selenium and pyperclip to help me accomplish my task. This is my code:
import sys
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as Ec
import pyperclip
print("This is a basic plagarism checker that removed of the hassle that comes with doing everything yourself")
i = 0
while i == 0:
open_file = input("What do you want to check, copy and paste it here:")
if len(open_file) >= 30: #ensures that text is sufficient enough to be checked
i += 1
else:
print("It is hard to check plagarism for a small amount of words, please enter some more!")
i = 0
driver = webdriver.Chrome("C:/Users/Shitty Horrible Pc/PycharmProjects/learningpython/pytjom/chromedriver.exe") #access the webdriver
pyperclip.copy(open_file) #copys your input
driver.implicitly_wait(10) #tells program to wait for specific objects on the website to load in
driver.get("http://plagiarisma.net/") #goes to the plagarism checker website
element = driver.find_element_by_id("query") #find text box
element.send_keys(open_file) #pastes in text box
element = driver.find_element_by_name("Submit") #finds checker button
element.click() #presses it and gives an authenticity report)
driver.implicitly_wait(10)
html = driver.find_element_by_tag_name('html')
if len(open_file) >= 200:
time.sleep(22)
else:
time.sleep(8)
for letter in "AAAAAAAAAAAAAAAAAA":
html.send_keys(Keys.ARROW_DOWN)
As you can see, I used pyperclip to copy an input given by the user and used selenium to paste it into a text-book. Everything works fine, but when I try to copy a very lengthy input, only the first line of the input is pasted (the input is broken into segments in my pycharm console). I have manually verified that the website I am using does not share that same restriction. This leads me to assume that pyperclip might have a character limit. Does anyone know if my assumptions are correct? If not, any ideas of what else it could be?