Sometime I am getting this error when it times out and can't find the reddit post. It happens about 70% of the time
Traceback (most recent call last):
File "/Users/amitozdeol/www/YouTubeAutomation-Reddit/main.py", line 112, in <module>
main()
File "/Users/amitozdeol/www/YouTubeAutomation-Reddit/main.py", line 37, in main
get_screenshots_of_reddit_posts(reddit_thread=thread, reddit_comments=comments, screenshot_num=1)
File "/Users/amitozdeol/www/YouTubeAutomation-Reddit/Graphics/screenshot.py", line 63, in get_screenshots_of_reddit_posts
page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath)
File "/opt/homebrew/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 16445, in screenshot
self._sync(
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 104, in _sync
return task.result()
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_locator.py", line 479, in screenshot
return await self._with_element(
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_locator.py", line 101, in _with_element
handle = await self.element_handle(timeout=timeout)
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_locator.py", line 285, in element_handle
handle = await self._frame.wait_for_selector(
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 322, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 44, in send
return await self._connection.wrap_api_call(
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 419, in wrap_api_call
return await cb()
File "/opt/homebrew/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 79, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator("[data-test-id=\"post-content\"]")
============================================================
Sometime I am getting this error when it times out and can't find the reddit post. It happens about 70% of the time