Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Guide] Running a working version of webbot #95

Open
pidgeon777 opened this issue Feb 14, 2024 · 2 comments
Open

[Guide] Running a working version of webbot #95

pidgeon777 opened this issue Feb 14, 2024 · 2 comments

Comments

@pidgeon777
Copy link

Warning

webbot library is no longer maintained. A fork is available here.

  1. Clone the fork:
git clone https://github.com/KonstantinLitvin/webbot.git
  1. Fix the webbot.py file:
diff --git a/webbot/webbot.py b/webbot/webbot.py
index 5bcbe96..38420a6 100644
--- a/webbot/webbot.py
+++ b/webbot/webbot.py
@@ -297,7 +297,7 @@ class Browser:
             add_to_init_text_matches_score(self.driver.find_elements(By.CSS_SELECTOR, css_selector), 80)
 
         if xpath:
-            add_to_init_text_matches_score(self.driver.find_elements(By.CSS_SELECTOR, xpath), 100)
+            add_to_init_text_matches_score(self.driver.find_elements(By.XPATH, xpath), 100)
 
         if not text and tag:
             element_fetch_helper(("//body//{}".format(tag)), score=50)

Note

By doing so it is possible to call the find_elements function with xpath argument without generating an error.

  1. Install the webbot library:
cd <path/to/webbot>
pip3 install .
  1. Install the latest ChromeDriver version.

pip3 list output:

Package                 Version
----------------------- -----------
attrs                   23.2.0
certifi                 2024.2.2
cffi                    1.16.0
charset-normalizer      3.3.2
h11                     0.14.0
idna                    3.6
outcome                 1.3.0.post0
pip                     23.3.1
pycparser               2.21
PySocks                 1.7.1
requests                2.31.0
selenium                4.17.2
setuptools              68.2.2
sniffio                 1.3.0
sortedcontainers        2.4.0
trio                    0.24.0
trio-websocket          0.11.1
typing_extensions       4.9.0
undetected-chromedriver 3.5.4
urllib3                 2.2.0
webbot                  0.4
websockets              12.0
wheel                   0.41.2
wsproto                 1.2.0

Python version: 3.12.1

@Roboxkin
Copy link

Thanks a lot! Thanks to you, now everything has stopped working for me and nothing will start

@pidgeon777
Copy link
Author

Some points:

  1. This guide has been tested on a new (clean) environment and everything worked. I think it is impossible to break everything (?) by just following those steps. The most critical one, for your Python environment, could be the pip3 install . part.
  2. Before doing anything, it is always a good thing to commit/backup. I am not quite sure you did that.
  3. I don't like your attitude. You're stating that "everything has stopped working", but what is "everything"? The search tool? These are simple steps which I don't think will lead to formatting your system.

If you broke something, whatever it means to you, you should at least report exactly what. But if this is your attitude, I don't think I'll spend my time helping.

Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants