playwright-community / heroku-playwright-buildpack

Buildpack for running Playwright with Chromium and Firefox on Heroku.
https://heroku.playwright.tech
48 stars 47 forks source link

'NoneType' object has no attribute 'get_property' #19

Open bugbounted opened 2 years ago

bugbounted commented 2 years ago

from 3 days ago , im getting error below on my heroku dyno runtime log :

2022-05-13T11:17:36.873464+00:00 app[api]: Enable Logplex by user sarinazar@protonmail.com 2022-05-13T11:17:36.873464+00:00 app[api]: Release v2 created by user sarinazar@protonmail.com 2022-05-13T11:17:37.248261+00:00 app[api]: Upgrade stack to heroku-20 by user sarinazar@protonmail.com 2022-05-13T11:17:37.248261+00:00 app[api]: Release v3 created by user sarinazar@protonmail.com 2022-05-13T11:17:37.430962+00:00 app[api]: Release v4 created by user sarinazar@protonmail.com 2022-05-13T11:17:37.430962+00:00 app[api]: Set PLAYWRIGHT_BUILDPACK_BROWSERS config vars by user sarinazar@protonmail.com 2022-05-13T11:17:38.000000+00:00 app[api]: Build started by user sarinazar@protonmail.com 2022-05-13T11:19:31.270101+00:00 app[api]: Deploy by user sarinazar@protonmail.com 2022-05-13T11:19:31.270101+00:00 app[api]: Release v5 created by user sarinazar@protonmail.com 2022-05-13T11:19:56.000000+00:00 app[api]: Build succeeded 2022-05-13T11:22:28.902270+00:00 heroku[worker.1]: Starting process with command playwright install && python main.py 2022-05-13T11:22:29.824507+00:00 heroku[worker.1]: State changed from starting to up 2022-05-13T11:22:43.138300+00:00 app[worker.1]: Playwright build of chromium v1000 downloaded to /app/.heroku/python/lib/python3.10/site-packages/playwright/driver/package/.local-browsers/chromium-1000 2022-05-13T11:22:43.375701+00:00 app[worker.1]: Playwright build of ffmpeg v1007 downloaded to /app/.heroku/python/lib/python3.10/site-packages/playwright/driver/package/.local-browsers/ffmpeg-1007 2022-05-13T11:22:48.448043+00:00 app[worker.1]: Playwright build of firefox v1322 downloaded to /app/.heroku/python/lib/python3.10/site-packages/playwright/driver/package/.local-browsers/firefox-1322 2022-05-13T11:22:53.964024+00:00 app[worker.1]: Playwright build of webkit v1630 downloaded to /app/.heroku/python/lib/python3.10/site-packages/playwright/driver/package/.local-browsers/webkit-1630 2022-05-13T11:22:55.698305+00:00 app[worker.1]: Status 429: Too many requests 2022-05-13T11:22:55.698405+00:00 app[worker.1]: Ignore 429: Continue login 2022-05-13T11:23:01.862029+00:00 app[worker.1]: Login sucscessful 2022-05-13T11:23:09.804720+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:09.804730+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:09.843398+00:00 app[worker.1]: for error! 2022-05-13T11:23:09.843400+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:09.846393+00:00 app[worker.1]: Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 42 is closed 2022-05-13T11:23:11.206315+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:11.206322+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:11.258236+00:00 app[worker.1]: for error! 2022-05-13T11:23:11.258264+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:12.658429+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:12.658793+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:12.690929+00:00 app[worker.1]: for error! 2022-05-13T11:23:12.690931+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:12.697415+00:00 app[worker.1]: Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 296 is closed 2022-05-13T11:23:13.952214+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:13.952224+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:13.988290+00:00 app[worker.1]: for error! 2022-05-13T11:23:13.988324+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:15.140770+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:15.140779+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:15.193298+00:00 app[worker.1]: for error! 2022-05-13T11:23:15.193300+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:15.196066+00:00 app[worker.1]: Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 554 is closed 2022-05-13T11:23:16.211616+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:16.211633+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:16.242568+00:00 app[worker.1]: for error! 2022-05-13T11:23:16.242570+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:17.196532+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:17.196550+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:17.234488+00:00 app[worker.1]: for error! 2022-05-13T11:23:17.234515+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:18.142944+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:18.142998+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:18.168668+00:00 app[worker.1]: for error! 2022-05-13T11:23:18.168699+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:19.233608+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:19.233626+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:19.278987+00:00 app[worker.1]: for error! 2022-05-13T11:23:19.279021+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:19.284386+00:00 app[worker.1]: Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 1058 is closed 2022-05-13T11:23:20.308325+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:20.308330+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:20.366542+00:00 app[worker.1]: for error! 2022-05-13T11:23:20.366544+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:21.391760+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:21.391807+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:21.429755+00:00 app[worker.1]: for error! 2022-05-13T11:23:21.429758+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:22.568353+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:22.568380+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:22.587455+00:00 app[worker.1]: for error! 2022-05-13T11:23:22.587458+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:23.639361+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:23.639377+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:23.663096+00:00 app[worker.1]: for error! 2022-05-13T11:23:23.663098+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:24.946923+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:24.946970+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:24.988222+00:00 app[worker.1]: for error! 2022-05-13T11:23:24.988250+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:25.993826+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:25.993833+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:26.035830+00:00 app[worker.1]: for error! 2022-05-13T11:23:26.035832+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:27.085769+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:27.085787+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:27.120342+00:00 app[worker.1]: for error! 2022-05-13T11:23:27.120344+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:28.121409+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:28.121511+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:28.158395+00:00 app[worker.1]: for error! 2022-05-13T11:23:28.158397+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:29.285169+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:29.285239+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:29.313627+00:00 app[worker.1]: for error! 2022-05-13T11:23:29.313660+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:30.585966+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:30.586016+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:30.647721+00:00 app[worker.1]: for error! 2022-05-13T11:23:30.647748+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:30.651327+00:00 app[worker.1]: Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 2339 is closed 2022-05-13T11:23:31.964345+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:31.964380+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:31.995473+00:00 app[worker.1]: for error!Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 2467 is closed 2022-05-13T11:23:31.995478+00:00 app[worker.1]: 2022-05-13T11:23:31.995481+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:33.099718+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:33.099725+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:33.125233+00:00 app[worker.1]: for error! 2022-05-13T11:23:33.125235+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:34.311763+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:34.311772+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:34.368024+00:00 app[worker.1]: for error!Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 2725 is closed 2022-05-13T11:23:34.368132+00:00 app[worker.1]: 2022-05-13T11:23:34.368178+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:35.558608+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:35.558623+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:35.590552+00:00 app[worker.1]: for error!Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 2851 is closed 2022-05-13T11:23:35.590626+00:00 app[worker.1]: 2022-05-13T11:23:35.590656+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:36.690806+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:36.691353+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:36.738135+00:00 app[worker.1]: for error!Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 2979 is closed 2022-05-13T11:23:36.738255+00:00 app[worker.1]: 2022-05-13T11:23:36.738289+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:37.994145+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:37.994151+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:38.044574+00:00 app[worker.1]: for error! 2022-05-13T11:23:38.044576+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:40.075682+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:40.075771+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:40.196033+00:00 app[worker.1]: for error! 2022-05-13T11:23:40.196061+00:00 app[worker.1]: cannot unpack non-iterable NoneType object 2022-05-13T11:23:41.552390+00:00 app[worker.1]: erorr get last video 2022-05-13T11:23:41.552463+00:00 app[worker.1]: 'NoneType' object has no attribute 'get_property' 2022-05-13T11:23:41.608103+00:00 app[worker.1]: for error! 2022-05-13T11:23:41.608134+00:00 app[worker.1]: cannot unpack non-iterable NoneType object

please help me to fix it also code of playwright python page is :

from playwright.sync_api import sync_playwright import requests import re

def get_last_video_url(username): with sync_playwright() as p: try: browser = p.chromium.launch() browser = browser.new_context( user_agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36") page = browser.new_page() page.goto("http://tiktok.com/@{}".format(username)) latest_video = page.query_selector( 'xpath=/html/body/div[2]/div[2]/div[2]/div/div[2]/div[2]/div/div/div[1]/div/div/a') url = latest_video.get_property('href') browser.close() return url except Exception as e: print("erorr get last video") print(e) return None

def get_download_url(username): url = get_last_video_url(username) if url == None: return None url = str(url) + '/' print(username) video_id = re.findall( r'https\:\/\/www.tiktok.com\/@{}\/video\/(.*?)\/'.format(username), url)[0] resopnses = requests.get( 'https://api-v1.majhcc.com/api/tk?url={}'.format(url)) print(resopnses.text) return resopnses.json()['link'], video_id

waiting for your response finest regards