StegSchreck / RatS

Movie Ratings Synchronization with Python
GNU Affero General Public License v3.0
270 stars 31 forks source link

[letterboxd] selenium.common.exceptions.ElementClickInterceptedException: because another element obscures it #176

Closed noyse27 closed 6 months ago

noyse27 commented 2 years ago

tried several times but always the same result:

noyse@MSI:~/RatS$ sudo python3 transfer_ratings.py --source trakt --destination letterboxd
===== Trakt: Parsing 12 pages with 662 movies in total
100% (662 of 662) |##############################################################| Elapsed Time: 0:32:45 Time:  0:32:45

===== Trakt: saved 662 parsed movies to /home/noyse/RatS/RatS/exports/20211125202703_Trakt.json
===== Letterboxd: performing loginTraceback (most recent call last):
  File "/home/noyse/RatS/transfer_ratings.py", line 271, in <module>
    main()
  File "/home/noyse/RatS/transfer_ratings.py", line 92, in main
    execute(args)
  File "/home/noyse/RatS/transfer_ratings.py", line 170, in execute
    execute_inserting(args, movies, parser)
  File "/home/noyse/RatS/transfer_ratings.py", line 192, in execute_inserting
    inserter = get_inserter_from_arg(destination)(args)
  File "/home/noyse/RatS/RatS/letterboxd/letterboxd_ratings_inserter.py", line 27, in __init__
    super(LetterboxdRatingsInserter, self).__init__(Letterboxd(args), args)
  File "/home/noyse/RatS/RatS/letterboxd/letterboxd_site.py", line 16, in __init__
    super(Letterboxd, self).__init__(args)
  File "/home/noyse/RatS/RatS/base/base_site.py", line 41, in __init__
    self._init_browser()
  File "/home/noyse/RatS/RatS/base/base_site.py", line 82, in _init_browser
    self.login()
  File "/home/noyse/RatS/RatS/base/base_site.py", line 98, in login
    self._click_login_button()
  File "/home/noyse/RatS/RatS/base/base_site.py", line 152, in _click_login_button
    login_button.click()
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webelement.py", line 672, in _execute
    return self._parent.execute(command, params)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 318, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <input class="button -action button-green" type="submit"> is not clickable at point (593,365) because another element <iframe id="zIframe_tyche_trendi_video" class="zeus_iframe" src="//cdn.playwire.com/bolt4/js/zeus/releases/4.3.65/frame/frame.html#id=tyche_trendi_video___pv=1___eu=true___eis=1637870414762"> obscures it
littlebirdiegr commented 2 years ago

same errors as well when trakt to letterboxd

noyse27 commented 2 years ago

it seems to be depending on the waiting time: when im changing in letterboxd_site.py from

    def _pre_login_action(self):
        time.sleep(2)

to

    def _pre_login_action(self):
        time.sleep(10)

and inbase_site.py from

   def _click_login_button(self):
        login_button = self.browser.find_element_by_xpath(self.LOGIN_BUTTON_SELECTOR)
        login_button.click()
        time.sleep(2)  # wait for page to load

to

    def _click_login_button(self):
        login_button = self.browser.find_element_by_xpath(self.LOGIN_BUTTON_SELECTOR)
        login_button.click()
        time.sleep(10)  # wait for page to load

it continues the import until the next error occurs

noyse@MSI:~/RatS$ sudo python3 transfer_ratings.py --source trakt --destination letterboxd --file /home/noyse/RatS/RatS/exports/20211125202703_Trakt.json
===== Trakt: performing login
===== loaded 662 movies from /home/noyse/RatS/RatS/exports//home/noyse/RatS/RatS/exports/20211125202703_Trakt.json
===== Letterboxd: posting 662 movies
===== saving movies to CSV

===== Letterboxd: matching the movies...
100% (662 of 662) |##############################################################| Elapsed Time: 0:00:20 Time:  0:00:20

ERROR: There was an exception inside Letterboxd (see below). Skipping insertion.

===== ABORTING =====
Traceback (most recent call last):
  File "/home/noyse/RatS/transfer_ratings.py", line 252, in insert_movie_ratings
    inserter.insert(movies, source)
  File "/home/noyse/RatS/RatS/letterboxd/letterboxd_ratings_inserter.py", line 42, in insert
    self.upload_csv_file(len(movies))
  File "/home/noyse/RatS/RatS/letterboxd/letterboxd_ratings_inserter.py", line 60, in upload_csv_file
    self._wait_for_movie_matching(wait, movies_count)
  File "/home/noyse/RatS/RatS/letterboxd/letterboxd_ratings_inserter.py", line 100, in _wait_for_movie_matching
    self.site.browser.find_element_by_xpath(enabled_import_button_selector).click()
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webelement.py", line 672, in _execute
    return self._parent.execute(command, params)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/webdriver.py", line 318, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <a class="button -action button-large button-action save-users-imported-imdb-history submit-matched-films add-import-films-to-list track-event" href="#"> is not clickable at point (529,509) because another element <iframe id="zIframe_tyche_trendi_video" class="zeus_iframe" src="//cdn.playwire.com/bolt4/js/zeus/releases/4.3.66/frame/frame.html#id=tyche_trendi_video___pv=4___eu=true___eis=1638483171411"> obscures it

but i do not know where i have to improve the waiting time so the import goes further

noyse27 commented 2 years ago

tried it on my vserver- same error there

StegSchreck commented 6 months ago

becomes obsolete by #306