I need to edit this file with any python module: https://1drv.ms/x/s!Aq2lKlhSyqf5mjiC6CYkC1QGXNSy?e=Wh88AT but I don't want to download it edit and then upload again. I tried using webbot, but I couldn't even find the 'editing mode' button.
import time
from time import sleep
from webbot import Browser
driver = Browser()
driver.new_tab(url='https://1drv.ms/x/s!Aq2lKlhSyqf5mjiC6CYkC1QGXNSy?e=Wh88AT')
driver.switch_to_tab(1)
driver.close_current_tab()
print("waiting...")
sleep(20)
print("start")
driver.click(classname = 'list-349' , tag = 'button' )
but it returns this:
Traceback (most recent call last):
File "main.py", line 19, in <module>
driver.click(classname = 'list-349' , tag = 'button' )
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/webbot/webbot.py", line 466, in click
maxElements = self.__find_element(text, tag, classname, id, number, css_selector, xpath, loose_match)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/webbot/webbot.py", line 294, in __find_element
element_fetch_helper(("//body//{}".format(tag)), score=50)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/webbot/webbot.py", line 202, in element_fetch_helper
add_to_init_text_matches_score(self.driver.find_elements_by_xpath(xpath), score)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 410, in find_elements_by_xpath
return self.find_elements(by=By.XPATH, value=xpath)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 1005, in find_elements
return self.execute(Command.FIND_ELEMENTS, {
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=91.0.4472.101)
(Driver info: chromedriver=2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf),platform=Linux 5.15.0-1012-gcp x86_64)
I'm using replit by the way.