wkaisertexas / tiktok-uploader

Automatically ⬆️ upload TikTok videos
https://pypi.org/project/tiktok-uploader/
MIT License
390 stars 91 forks source link

Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"} #8

Closed tidusete closed 1 year ago

tidusete commented 1 year ago

Hey It´s me again, I have been following all the documentation + checking 'example_series_upload.py' but when I'm trying to upload a video I have the following error:

WDM] - Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.80M/6.80M [00:00<00:00, 39.4MB/s]

DevTools listening on ws://127.0.0.1:61368/devtools/browser/50440715-fb1f-4b21-b1b2-c93e21d70d86
[19812:23244:0414/191704.168:ERROR:cert_issuer_source_aia.cc(34)] Error parsing cert retrieved from AIA (as DER):
ERROR: Couldn't read tbsCertificate as SEQUENCE
ERROR: Failed parsing Certificate

Upload exception: Message: 
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

Upload exception: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=112.0.5615.86)
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

Upload exception: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='file']"}
  (Session info: chrome=112.0.5615.86)
Stacktrace:
Backtrace:
        GetHandleVerifier [0x011EDCE3+50899]
        (No symbol) [0x0117E111]
        (No symbol) [0x01085588]
        (No symbol) [0x010B08F9]
        (No symbol) [0x010B0AFB]
        (No symbol) [0x010DF902]
        (No symbol) [0x010CB944]
        (No symbol) [0x010DE01C]
        (No symbol) [0x010CB6F6]
        (No symbol) [0x010A7708]
        (No symbol) [0x010A886D]
        GetHandleVerifier [0x01453EAE+2566302]
        GetHandleVerifier [0x014892B1+2784417]
        GetHandleVerifier [0x0148327C+2759788]
        GetHandleVerifier [0x01285740+672048]
        (No symbol) [0x01188872]
        (No symbol) [0x011841C8]
        (No symbol) [0x011842AB]
        (No symbol) [0x011771B7]
        BaseThreadInitThunk [0x75DB0099+25]
        RtlGetAppContainerNamedObjectPath [0x772C7B6E+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B3E+238]

It's really strange because it uploads the video but doesn't change the Caption + Doesn't click to post. Any tip on that? I was trying to check as well on my browser the selector":"//input[@type='file']" inside the webpage and I didn't find it. Maybe they have changed that?

tidusete commented 1 year ago

Ok so basically the error is on upload.py. I have to keep investigating if it is a condition race error.

            WebDriverWait(driver, config['explicit_wait']).until(upload_progress)
            WebDriverWait(driver, config['explicit_wait']).until_not(upload_progress)

I got stuck on this line WebDriverWait(driver, config['explicit_wait']).until(upload_progress) And after that I have the following error:

Upload exception: Message: 
wkaisertexas commented 1 year ago

You can honestly just comment those two lines out. It is a redundant check to make sure that the video has been uploaded. The program goes on to later check if the description box is filled out which works too.