-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - playwright._impl._api_types.Error: TypeError: undefined is not an object (evaluating 'S[A][m(a[oprand[1]],oprand[1])]') #1012
Comments
Same issues with me as well. Traceback (most recent call last): |
I observe the same issue. |
I have the same |
Downgrading playwright version to 1.30.0 fixed the issue |
worked for me too. is there a way to pin this to the top or smth? idk im new to github. ty for your solution mr genius |
Same issue; even after the playwright version changes it still occurs. |
Same issue: I got same error playwright 1.32 |
Same issue after using playwright 1.3.0 |
downgraded but still same error |
using playwright 1.30.0 solve this problem |
I am also encountering this |
had the same issue with 1.32, got the error, downgraded to 1.30 and compile without issues but don't actually return any results |
same here as well |
Check this out |
Still having this issue, anyone know the soloution? |
Followed the link @Omak2r3a suggested and got it working |
same issue |
Version 1.34.0 with the same issue |
how to solve this problem? code is not working from TikTokApi import TikTokApi # Watch https://www.youtube.com/watch?v=-uCt1x8kINQ for a brief setup tutorial with TikTokApi() as api: for trending_video in api.trending.videos(count=50): # Prints the author's username of the trending video. print(trending_video.author.username) |
I still have no idea, i am so lost with this. I am running on MacOS gives me the same error despite running different forms and code etc...
my code: `from TikTokApi import TikTokApi def get_cookies_from_file():
cookies = get_cookies_from_file() def get_cookies(**kwargs): api = TikTokApi() api._get_cookies = get_cookies # This fixes issues the api was having for video in api.trending.videos(): |
@RyanCCY how were you able to downgrade the playright version to 1.30.0? did you fix the issue? |
The steps I took to resolve this issue
Here is the code I had:
|
This worked perfectly for me. Thanks :) |
The steps I took to resolve this issueThe directory structure is as follows: tiktok Dockerfile FROM mcr.microsoft.com/playwright:v1.30.0-focal
RUN apt-get update && apt-get install -y python3-pip
# Install Playwright and then install the browsers:
RUN pip install --force-reinstall -v "playwright==1.30.0"
RUN playwright install
RUN pip3 install TikTokApi
WORKDIR /app
COPY . . docker-compose.yml version: '3.8'
services:
python-app:
build: .
volumes:
- .:/app
tty: true tiktok.py from TikTokApi import TikTokApi
import json
def get_cookies_from_file():
with open('./cookies.json') as f:
cookies = json.load(f)
cookies_kv = {}
for cookie in cookies:
cookies_kv[cookie['name']] = cookie['value']
return cookies_kv
cookies = get_cookies_from_file()
def get_cookies(**kwargs):
return cookies
with TikTokApi() as api:
api._get_cookies = get_cookies
for trending_video in api.trending.videos(count=10):
print(trending_video.author.username) cookies.json The cookies.json file is exported using the Chrome extension EditThisCookie to get the cookie information from TikTok. (This assumes that you are already logged in to TikTok.) When you press the export button, it is copied to the clipboard, so you can paste it directly into cookies.json. Then, by executing the following commands, I was able to retrieve the user. Check the current directory pwd
Output ~/tiktok Enter the container docker-compose exec python-app bash Execute the following in the container root@:/app# python3 tiktok.py |
Probably fixed in V6 |
This is a weird issue, I can't seem to figure it out. But it works if you specify
this throws the error
Doesn't, and most other attribute accesses seem to work fine. It feels like a weird way that playwright must've changed handling this in But this script works normally so it might be an issue on how this library is assigning pages? import asyncio
from playwright.async_api import async_playwright
async def run():
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True) # Set headless=True to run without UI
page = await browser.new_page()
await page.goto('https://tiktok.com')
user_agent = await page.evaluate("() => navigator.userAgent")
print(user_agent)
await page.wait_for_timeout(5000)
await browser.close()
asyncio.run(run()) |
Encounters typeerror each time I try running the code.
Could I kindly check how to resolve? Thank you.
The text was updated successfully, but these errors were encountered: