[Bug]: waiting for locator("[name=\"username\"]")
Brncray opened this issue · comments
Describe the bug
While running the file without storymode enabled, i get the following error
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Sorry, something went wrong with this version! Try again, and feel free to report this issue at GitHub or the Discord community. │
│ Version: 3.2.1 │
│ Error: Error: strict mode violation: locator("[name=\"username\"]") resolved to 3 elements: │
│ 1) <input type="text" required="" name="username" id="logi…/> aka locator("input[name=\"username\"]") │
│ 2) <auth-text-input required="" name="username" id="login-username" …>…</auth-text-input> aka get_by_text("Email or username *") │
│ 3) <faceplate-form-helper-text class="" message="" name="username" placeholder=…> </faceplate-form-helper-text> aka get_by_role("group").filter(has_text="Email or username │
│ *").locator("faceplate-form-helper-text") │
│ │
│ =========================== logs =========================== │
│ waiting for locator("[name=\"username\"]") │
│ ============================================================ │
│ Config: {'allow_nsfw': False, 'theme': 'dark', 'times_to_run': 1, 'opacity': 0.9, 'storymode': False, 'storymodemethod': 1, 'storymode_max_length': 1000, 'resolution_w': 1080, 'resolution_h': 1920, │
│ 'zoom': 1.0, 'background': {'background_video': 'minecraft', 'background_audio': 'lofi', 'background_audio_volume': 0.15, 'enable_extra_audio': False, 'background_thumbnail': False, │
│ 'background_thumbnail_font_family': 'arial', 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, 'tts': {'voice_choice': 'streamlabspolly', 'random_voice': │
│ False, 'elevenlabs_voice_name': 'Bella', 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': 'Matthew', 'streamlabs_polly_voice': 'Matthew', 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': │
│ 'REDACTED', 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0.3, 'no_emojis': False}} │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Traceback (most recent call last):
File "D:\RedditVideoMakerBot\main.py", line 132, in <module>
raise err
File "D:\RedditVideoMakerBot\main.py", line 114, in <module>
run_many(config["settings"]["times_to_run"])
File "D:\RedditVideoMakerBot\main.py", line 69, in run_many
main()
File "D:\RedditVideoMakerBot\main.py", line 53, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "D:\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 107, in get_screenshots_of_reddit_posts
page.locator('[name="username"]').fill(settings.config["reddit"]["creds"]["username"])
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\sync_api\_generated.py", line 16045, in fill
self._sync(
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_sync_base.py", line 109, in _sync
return task.result()
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_locator.py", line 212, in fill
return await self._frame.fill(self._selector, strict=True, **params)
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_frame.py", line 528, in fill
await self._channel.send("fill", locals_to_params(locals()))
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_connection.py", line 61, in send
return await self._connection.wrap_api_call(
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_connection.py", line 482, in wrap_api_call
return await cb()
File "C:\Users\Brendon O\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_connection.py", line 97, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.Error: Error: strict mode violation: locator("[name=\"username\"]") resolved to 3 elements:
1) <input type="text" required="" name="username" id="logi…/> aka locator("input[name=\"username\"]")
2) <auth-text-input required="" name="username" id="login-username" …>…</auth-text-input> aka get_by_text("Email or username *")
3) <faceplate-form-helper-text class="" message="" name="username" placeholder=…> </faceplate-form-helper-text> aka get_by_role("group").filter(has_text="Email or username *").locator("faceplate-form-helper-text")
=========================== logs ===========================
waiting for locator("[name=\"username\"]")
============================================================ ```
### Reproduction Steps
Run the file without storymode enbabled.
### Expected behavior
I expected it to run properly
### Screenshots
_No response_
### System Information
Operating System : [e.g. Windows 11] Windows 11
Python version : [e.g. Python 3.6] 3.10
App version / Branch : [e.g. latest, V2.0, master, develop] Latest
### Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
### Additional Context
_No response_
https://github.com/elebumm/RedditVideoMakerBot/pull/1986/files
go here and copy the changed code into the files indicated.