webbot
webbot copied to clipboard
[Guide] Running a working version of `webbot`
[!WARNING]
webbotlibrary is no longer maintained. A fork is available here.
- Clone the fork:
git clone https://github.com/KonstantinLitvin/webbot.git
- Fix the
webbot.pyfile:
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_elementsfunction withxpathargument without generating an error.
- Install the
webbotlibrary:
cd <path/to/webbot>
pip3 install .
- Install the latest
ChromeDriverversion.
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
Thanks a lot! Thanks to you, now everything has stopped working for me and nothing will start
Some points:
- 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. - Before doing anything, it is always a good thing to commit/backup. I am not quite sure you did that.
- 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!