Skip to content

Commit

Permalink
Small fix in iframe logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav4167 committed Sep 15, 2023
1 parent e6a43b6 commit aecf1e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Seleniumbase
downloaded_files/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name = "youchat-py" # Required
#
# For a discussion on single-sourcing the version, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version = "1.1.2" # Required
version = "1.1.3" # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down
4 changes: 2 additions & 2 deletions youchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ def you_message(text: str, out_type: str = 'json'):
if sb.assert_element('iframe'):
sb.switch_to_frame("iframe")
sb.find_element(".ctp-checkbox-label", timeout=0.1).click()
sb.switch_to_default_content()
# sb.save_screenshot('sel2.png') # Debug
except Exception:
result['error'] = 'Selenium was detected! Try again later. Captcha not solved automaticly.'

if stream_available:
result.pop('error')
sb.switch_to_default_content()
data = sb.get_text("body pre")
break
sb.switch_to_default_content()


res_message = ""
for line in data.split("\n"):
Expand Down

0 comments on commit aecf1e6

Please sign in to comment.