You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various exceptions are raised when WhatsApp settings are set to anything other than English because there are a few areas in WhatSoup that depend on English characters/words. The date/time formats for non-English settings are likely different as well and also need to be revised with a more flexible solution such as dateutil.
Temporary workaround
Set WhatsApp settings on the phone to use English as the language before running the script. It can be changed back after scraping/exporting a chat.
Issue details
WhatSoup areas that depend on English language/locale:
Identifying 'Search results' element after searching for a specific chat
Loading all messages in a selected chat, has an xpath containing 'Message list'
Finding sender when a message does not contain text, has a condition for 'Voice message'
Determining if vCard/VCF media is in a message, has conditions for 'Message' and 'Add to a group'
Date/time string formatting all expects in the format of MM/DD/YYYY HH:MM AM/PM but there are variations such as YYYY-MM-DD, A.M. / P.M., etc.
Identifying search results
# Look for the unique class that holds 'Search results.'
WebDriverWait(driver, 5).until(expected_conditions.presence_of_element_located(
(By.XPATH, "//*[@id='pane-side']/div[1]/div/div[contains(@aria-label,'Search results.')]")))
Loading all messages
# Set focus to chat window (xpath == div element w/ aria-label set to 'Message list. Press right arrow key...')
message_list_element = driver.find_element_by_xpath(
"//*[@id='main']/div[3]/div/div/div[contains(@aria-label,'Message list')]")
Finding sender when a message does not contain text
# Last char in aria-label is always colon after the senders name
if span.get('aria-label') != 'Voice message':
return span.get('aria-label')[:-1]
Determining if vCard/VCF media is in a message
# Check if 'Message' is in the title (full title would be for example 'Message Bob Ross')
if 'Message' in button.get('title'):
# Next sibling should always be the 'Add to a group' button
if button.nextSibling:
if button.nextSibling.get('title') == 'Add to a group':
return True
The text was updated successfully, but these errors were encountered:
Issue
Various exceptions are raised when WhatsApp settings are set to anything other than English because there are a few areas in WhatSoup that depend on English characters/words. The date/time formats for non-English settings are likely different as well and also need to be revised with a more flexible solution such as dateutil.
Temporary workaround
Set WhatsApp settings on the phone to use English as the language before running the script. It can be changed back after scraping/exporting a chat.
Issue details
WhatSoup areas that depend on English language/locale:
Identifying search results
Loading all messages
Finding sender when a message does not contain text
Determining if vCard/VCF media is in a message
The text was updated successfully, but these errors were encountered: