Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Discord or channel in non-English languages #10

Open
tttollerer opened this issue Dec 20, 2023 · 1 comment
Open

Discord or channel in non-English languages #10

tttollerer opened this issue Dec 20, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@tttollerer
Copy link

There are various problems with the DOM addressing, e.g. if the Discord client is not set to English or the channel was not created by an English client.

This affects the following lines, for example:

145 messages = await page.query_selector_all(".messageListItem-ZZ7v6g")
154 image_elements = await page.query_selector_all('.originalLink-Azwuo9')
185 pill_value_locator = 'span.optionPillValue-2uxsMp'
258 messages = await page.query_selector_all(".messageListItem-ZZ7v6g")
395 chat_bar = page.get_by_role('textbox', name='Message #general')
404 prompt_option_selector = "#autocomplete-0 > .base-2v-uc0"

Unfortunately, there also seems to be no solution to provide the classes with whitespaces like
404 prompt_option_selector = "#autocomplete-0 > .base-2v-uc0"
->
prompt_option_selector = "#autocomplete-0 > [class^='base']"

I think you have to go through the position in the DOM.

@tttollerer
Copy link
Author

This is how it seems to work across different channels and languages:

145 messages = await page.query_selector_all("[class*='messageListItem']")
154 image_elements = await page.query_selector_all("[class*='originalLink']")
185 pill_value_locator = "span[class*='optionPillValue']"
258 messages = await page.query_selector_all("[class*='messageListItem']")
395 chat_bar = page.locator("div[role='textbox'][aria-label^='Message #']")
404 prompt_option_selector = "#autocomplete-0"

@harmindersinghnijjar harmindersinghnijjar added the documentation Improvements or additions to documentation label Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants