Giter Site home page Giter Site logo

nateshmbhat / webbot Goto Github PK

View Code? Open in Web Editor NEW
239.0 7.0 87.0 12.45 MB

Web automation library for simple and easy end to end testing and web browser automation that offers super charged features while keeping it simple to use and master

Home Page: https://pypi.org/project/webbot/

License: Mozilla Public License 2.0

Python 100.00%
python3 webbot automation web-automation python web-driver

webbot's Introduction

🤖 Crazy Smart Web automation and testing library for python

Downloads Downloads

webbot provides a much feature rich automation than selenium for all kinds of automation of webpage. Since the major portion of web automation is to perform actions like click and type into webpage elements , webbot automatically handles finding the right elements to perform the actions.

Buy me a coffee 😇Buy me a coffee 😇

Features :

  • Click any button or link without having to worry about finding the element first or knowing css_selectors , xpath etc
  • Automate and test pages loaded dynamically by javascript.
  • Smart scoring algorithm which finds the best matching elements on which you want to perform the action .
  • The entire automation process can be made without having to open the browser window i.e in the background as a console process (see docs for more details )
  • Use any combination of selectors like id, name, text, css etc to perform actions on elements with one line of code.
  • Automation designed to work even in case of webpages with dynamically changing id and classname
  • Immensely minimizes the code required for performing input actions like clicks and keyboard actions.
  • Get webpage source , cookies , total tabs , webpage title etc..
  • Simulate key presses and special key combinations
  • Bidirectional scrolling
  • Perform an action on webpage elements by applying various filters to select the elements .
  • Perfrom action on multiple elements at once.

Installation :

pip install webbot

If "No distribution found error occurs" just update setuptools using pip install --upgrade setuptools

Quickstart :

Demo code 0 :
from webbot import Browser 
web = Browser()
web.go_to('google.com') 
web.type('hello its me')  # or web.press(web.Key.SHIFT + 'hello its me')
web.press(web.Key.ENTER)
web.go_back()
web.click('Sign in')
web.type('[email protected]' , into='Email')
web.click('NEXT' , tag='span')
web.type('mypassword' , into='Password' , id='passwordFieldId')
web.click('NEXT' , tag='span') # you are logged in . woohoooo

Demo code 1 :

If multiple buttons with similar properties are to be clicked at once

web = Browser()
web.go_to('siteurl.com')
web.click('buttontext' , multiple = True)
Demo code 2 :

If there are multiple elements and you want to perform action on one of them

web = Browser()
web.go_to('siteurl.com')

# types the text into the 3rd input element when there are multiple input elements with form-input class
web.type('im robo typing' , number = 3 , classname="form-input" ) 

web.click('Post')


Links :

webbot's People

Contributors

danksidesparkles avatar dillonb07 avatar gitpushpulllegs avatar hoggatt avatar leonheess avatar nateshmbhat avatar noesberger avatar paszymaja avatar qinfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

webbot's Issues

Cannot install with pip or git in command line

Hello,

I am having issues trying to install the package to my RPi. I have tried both 'pip install webbot' and 'python -m pip install git+https://github.com/nateshmbhat/webbot.git'. I get similar messages which are listed below:

pip install webbot

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.

Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.

To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple

Collecting webbot Using cached webbot-0.34.tar.gz (12.9 MB) ERROR: Command errored out with exit status 1: command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-KP_5mI/webbot/setup.py'"'"'; __file__='"'"'/tmp/pip-install-KP_5mI/webbot/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-UKP1LA cwd: /tmp/pip-install-KP_5mI/webbot/ Complete output (5 lines): Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-KP_5mI/webbot/setup.py", line 8, in <module> with open('README.rst', 'r', encoding='utf-8') as f: TypeError: 'encoding' is an invalid keyword argument for this function ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Can anyone assist with this issue? It looks like the computer is hung up on the encoding argument when trying to set up the package. I am excited to try this package out, so any assistance would be great. Thanks!

exists() css_selector problems with attribute selectors

https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
https://www.w3schools.com/cssref/css_selectors.asp

if web.exists(tag='button', classname='yt-icon-button', css_selector='button[aria-label*="Current setting is all notifications."]', number=1, loose_match=False):
        return 0 # can't enable push notifications
    else:
        return 1

Running the following code when logged into Youtube, 1 is returned instead of 0. The method should detect if the button exists based on the aria-label css_selector.

Either it is Youtube, or the webbot library, but the css selector doesn't seem to work here. This was tested in an environment with purely the button's element in the html body. A JS querySelector in a script element with the same css_selector worked fine in contrast.

[Suggestion] Get text content from element

Hi there, in my current program I need an option to fetch data from elements on the page while the bot is working as the value is from a timer that is constantly changing, is it possible that you could add that?

Kind regard's
BlackFalcons

How to hide errors ?

Hello,

How can i hide errors in visual studio code (windows), like this :

[4332:11760:1015/082644.419:ERROR:gl_utils.cc(316)] [.RendererMainThread-0000025B86B53A10] GL_INVALID_FRAMEBUFFER_OPERATION: Draw framebuffer is incomplete

This spam me

HTML form - input elements using id tag cannot be reached

Hi Natesh,

I would like to thank you for the amazing webbot python API (latest ver: 0.1.4), I started using it for different web automation sites and appreciated.

One technical API issue found: if the web HTML page, has an HTML form and most input types does not have an HTML ID like below example, then your webbot Python API does not work well. Why?

<form method="post" name="form" action="login.cgi" target="">
<input type="text" id="login_username" name="login_username" tabindex="1" class="form_input" maxlength="20" autocapitalize="off" autocomplete="off" placeholder="Username">
<input type="password" name="login_passwd" tabindex="2" class="form_input" maxlength="16" placeholder="Password" autocapitalize="off" autocomplete="off">
  | .......
 

Then using webbot API here for password does not work at all:
web.type('password_value', into='login_passwd') # or
web.type('password_value', into='login_passwd', tag='password')

Thanks and appreciated if you can fix this, really important for the Webbot API

Mohee Jarada

Shift doesn't work

You can't interact using shift keys, which kinda makes it hard to use @ signs and other stuff like that. Is there a way to fix it?

Browser file not found

using the sample code I have been getting the following output
Traceback (most recent call last): File "C:\Users\user\Desktop\file.py", line 2, in <module> web = Browser() File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\webbot\webbot.py", line 50, in __init__ os.chmod(driverpath , 0o755 ) FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages\\webbot\\drivers\\chrome_windows'

The file does exist the in the given directory, I'm assuming that I've bugged up the installation somehow?

(selenium is installed, maybe also an issue with pip?)

browser function

When I execute function browser() I get his error, someone can help me ?

Browser()
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\webbot\webbot.py", line 58, in init
self.driver = webdriver.Chrome(executable_path=driverpath , chrome_options=options)
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\paulo\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.18363 x86_64)

Remove info bars at top of chome window

I used webbot to set up a dashboard in our office. When chrome opens up it displays

Browser is being controlled by test sofware

Is there a way to remove this? I know that in selenium you can disable it through chrome.options.

Code 127 on fresh Ubuntu LTS Server

Running any of the sample code or the code from my project yields the same result regardless if invoked through sudo or otherwise.

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
from webbot import Browser
driver = Browser(showWindow=False) 
#This has already been tested with the default __init__ "showWindow=True" and yeilds the same result.

Returns the following:

daweshen@discordbot:~/DiscordBot$ python3 test.py
Traceback (most recent call last):
  File "test.py", line 2, in <module>
    driver = Browser(showWindow=False)
  File "/home/daweshen/.local/lib/python3.8/site-packages/webbot/webbot.py", line 68, in __init__
    self.driver = webdriver.Chrome(executable_path=driverpath, options=options)
  File "/home/daweshen/.local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/daweshen/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/home/daweshen/.local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 109, in assert_process_still_running
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service /home/daweshen/.local/lib/python3.8/site-packages/webbot/drivers/chrome_linux unexpectedly exited. Status code was: 127

Checking for Chromium Driver installation:

daweshen@discordbot:~/DiscordBot$ sudo snap install chromium
snap "chromium" is already installed, see 'snap help refresh'
daweshen@discordbot:~/DiscordBot$ sudo apt-get install -y chromium-browser
Reading package lists... Done
Building dependency tree
Reading state information... Done
chromium-browser is already the newest version (1:85.0.4183.83-0ubuntu0.20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.

Not sure what other information would be needed to assist with this. I could probably pull down 18.04 LTS and give that a whirl if its a versioning issue between Ubuntu 20 and 18. I know that this had no issues on my Win10 Desktop, so not 100% sure where to look here or if this is an inherent problem with my Ubuntu deployment being headless. Any guidance would be appreciated!

Edit: Added version info in the beginning of statement.

Unable to login directly through google (suggestion/fix)

After a while I found that you can login through a third party such that allows usage of their 'Login with Google' service (ex. Github / Stack overflow).

To have the login be in the scope of all tabs, enabling 'Allow Chrome sign-in' at chrome://settings/syncSetup works. This might be a nice addition to the docs.

exists(id=' ') method always returns True

@nateshmbhat The exists() method with any constructor inside it, always returns True despite entering random values.

You can try this code snippet. It always returns True.

from webbot import Browser

driver = Browser()
driver.go_to('https://github.com/login')

print(driver.exists(id='1234qwerty'))
print(driver.exists(css_selector='input[name="8888888"]'))
print(driver.exists(xpath='//input[@id="asdfg"]'))

Could you please check and fix this bug? My QA code makes extensive use of 'exists()' method. It will be very helpful. Thanks.

Does it work on a headless server?

First: I LOVE IT!
With this library, everything gets easy and works!

I plan to use it on a server without any screen. Does the library work in a headless browser?
What are the requirements?

First check results in:

[...]
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.39.562737 (abcdefg),platform=Linux 4.15.0-64-generic x86_64)

UPDATE:
When I am in the Python shell nothing happens after web = Browser() and I have to CTRL-C the shell to get out...

Thank you for your help!

Driver selection issue, for Mac OSX Mojave

in webbot.py

I feel that this edit is more significant to resolving which driver to use..

  if(not showWindow):
            options.set_headless(headless=True) ; 

        driverfilename = "chrome_linux" if  sys.platform=='linux' or sys.platform=="linux2" else "chrome_windows.exe" if sys.platform=='win32' else "chrome_mac" ;
        driverpath =  os.path.join(os.path.split(__file__)[0] , 'drivers{0}{1}'.format(os.path.sep , driverfilename))

AttributeError: 'WebDriver' object has no attribute 'fullscreen_window'

My script test:

from webbot import Browser

driver = Browser()
driver.go_to('google.com')

driver.click('Sign In') ;
driver.click('Sign In' , tag='span' ) ;
driver.click(id = 'elementid') ;

if there are multiple elements matching the text "NEXT" , then 2'nd element is clicked (since number paramter is 2 ) .

driver.click("NEXT" , tag='span' , number = 2 ) ;

error:

pyenv/versions/3.6.6/lib/python3.6/site-packages/webbot/webbot.py in (.0)
55
56
---> 57 [setattr(self , function , getattr(self.driver , function) ) for function in ['add_cookie' ,'delete_all_cookies','delete_cookie' , 'execute_script' , 'execute_async_script' ,'fullscreen_window','get_cookie' ,'get_cookies','get_log','get_network_conditions','get_screenshot_as_base64' ,'get_screenshot_as_file','get_screenshot_as_png','get_window_position','get_window_rect','get_window_size','maximize_window','minimize_window','implicitly_wait','quit','refresh','save_screenshot','set_network_conditions','set_page_load_timeout','set_script_timeout','set_window_position','set_window_rect','start_client','start_session','stop_client','switch_to_alert']]
58
59

AttributeError: 'WebDriver' object has no attribute 'fullscreen_window'

help-me

exists() incorrect arg in documentation

In the documentation it lists
multiple : if True , the specified action is performed on all the elements matching the criteria and not just the first element . If it is true , number parameter is ignored . Defaults to False under the exists() args, however the function doesn't have this feature. Removing from the docs would clear up misconceptions and confusion

How to use cookie?

Hello.
Sorry for a very stupid question, but could you please show by example code how to save and load cookies?
Thank you very much. And have nice day.
(I really really need it, I spent two hours and all without success)

Selenium ModuleNotFound Error

When using webbot and its dependencies (selenium, urllib3) not in a virtual environment installed through pip, but in the same folder (ex. a library folder), selenium cannot be found through the relative imports in webbot.py.

A fix for this would be adding this to the beginning of the file (could be better optimized to include only specific methods):
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

I haven't gotten this to fully work as of yet without error, so I wouldn't implement just yet. I'll let you know once I get it working, perhaps with a pull request

aarch64 GNU/Linux support

Currently I'm able to install webbot but not instantiate Browser

>>> web = Browser()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.venv38/lib64/python3.6/site-packages/webbot/webbot.py", line 52, in __init__
    self.driver = webdriver.Chrome(executable_path=driverpath , chrome_options=options)
  File "/.venv38/lib64/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/.venv38/lib64/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/.venv38/lib64/python3.6/site-packages/webbot/drivers/chrome_linux'

How to get text content of an object ?

Hello,

How to get text content of an object ?

I try like that :

#try to read text
if web.exists(classname='name') == True :

    print('name : ')

    player_name = web.find_elements(classname='name')[0].text

    print(player_name)

`

Thanks for help

Add Geckodriver for Firefox

Chrome still is not the best option for test automation with selenium.
For example, headless mode you cannot download files
I test webbot and the same happen. I know its selenium and chrome driver under the layer abtraction.
Please consider this issue for future versions!

Can't find an element by ID even though it's there.

Hey,

Firstly, a brilliant job on the API. It's really nice and simple and gets work done! I'm using it to scrap some data off of a web-app that didn't have an API of its own.

Here's the issue: I'm trying to click a link which has its ID, name, text, href and more stuff as well. I can see it rendered on the page, I can see it while inspecting the page in Chrome and it has all the attributes stated before. But for some reason, webbot can't seem to find it (tested using browser.find_elements) or click on it.

Can you please help me out here? Is this a legitimate bug?

Google Chrome will not allow login to gmail account.

When running the demo code to access gmail, Google Chrome will stop working saying that the browser is not safe. Checking why, google says it will not allow a login when the browser is handled by software and not by a person.

Since this is the first time I am trying webbot, I don't know if this is a new issue or not.

'WebDriver' object has no attribute 'switch_to_alert'

Hi Natesh - I've been using webbot to automate some browser tasks and recently moved my code to a new mac. I am getting an attribute error on the web=Browser() code - the Chrome window launches, but then nothing happens, and I get the attribute error. I think the problem is either with Chrome (so I reinstalled) or in the Selenium code you wrapped (saving me lots of reading and time - thank you!), but wanted to check with you to see if there was a simple solution.

Thanks!

Darrin

pip installation not working from Mac OS X

Related to this PyPi issue,
webbot installation via pip on Mac OS X Mojave is not working with Python 2.

Error message:

 Could not find a version that satisfies the requirement webbot (from versions: 0.0.1.win-amd64)

From the PyPi Issue:

The other (webbot-0.0.1.win-amd64.zip) is a source distribution, but the version number portion (0.0.1.win-amd64) is either invalid and hence getting rejected, or specifies that the source is for a specific platform different than the one you're running on, and also getting rejected (honestly, I'm not sure if "platform tags" are allowed/respected in source distribution filenames).

And potential solution:

So the fix is either to use a recent version of pip on Python 3, or to upload new wheels and source distributions with correct filenames and metadata.

Or, if webbot is only supported by Python 3, it would be good to write so in the documentation.

'Browser' object has no attribute 'find_elements'

My code:

from webbot import Browser

web = Browser()
web.find_elements('Web Development')

Output

web.find_elements('Web Development')
AttributeError: 'Browser' object has no attribute 'find_elements'

failed to installation webbot

ERROR: Could not find a version that satisfies the requirement webbot (from versions: 0.0.1.win-amd64)
ERROR: No matching distribution found for webbot

find_elements returning too many things?

it's probably me not understanding how this is supposed to work, but if I issue the following javascript

document.querySelectorAll('div[class^=addressContainer]')

I get 3 elements returned

If I do this in webbot, I get 64

w.find_elements(css_selector='div[class^=addressContainer]')

However if I do this

w.driver.find_elements_by_css_selector('div[class^=addressContainer]')

it returns 3 elements

what am I doing wrong?

xpath

how to query xpath value that similar to urllib2 below :

xpath('//label[@for="spam_protection"]/text()')

I can use this ' web.find_elements(xpath="//label[contains(.,'spam_protection')]") ' but only get true/false, how to get it's value ?

TypeError: 'module' object is not callable

I am using the webbot module in many projects.
Now I wanted to use it on another system (both Ubuntu 18.04) and with the simple basic code:

import webbot as Browser
import time

web = Browser(showWindow=False)
time.sleep(1)

web.quit()

I do get this error message: TypeError: 'module' object is not callable

Any ideas how to solve it?
Thanks a lot.

Update:
The same code and much more useful codes are running on other systems of mine. So I am confused what it means. I do not get an error for just using import webbot as Browser.

Conversion of a Python script using webbot module to an .exe file

As I tried to convert my running Python (3.6.5) script to an .exe file using pyinstaller I was getting an error that the path of the webbot module could not be found.

In order to overcome this problem I tried to specify the path of the module in the spec file, without success. An easier workaround suggests copying the downloaded folder webbot in the same folder where the .exe file is.

But in order for this to work you should not convert it as one file like this

pyinstaller --onefile file.py

but like this

pyinstaller file.py

After doing this the .exe could be launched without any problems.

An other error was coming because of trying to import webbot in my script. Probably this is a noob mistake, but one has to:

from webbot import Browser

All in all, a very handy and easy to use module

Issue with automatic web.type() method

Hello,

I face an issue with web.type(). It is not working on all pages. An example for this is www.airbnb.com.
I tried to give the corresponding "id" element names as well. It is not clear how this method is working.
Is there any way to provide the "into" or "id" parameters with a list, so that we can initially declare all the possible names as a list and then pass this list as a parameter?

Thanks in advance,
Sreekanth

Error after freezing

I froze the code, made it into an exe with pyinstaller --onefile then this error comes up
The system cannot find the path specified: 'C:\Users\loksa\AppData\Local\Temp\_MEI215642\webbot\drivers\chrome_windows.exe'
It works fine when I'm running it with pycharm.
Here's my code: https://hastebin.com/mojisokolo.py

I can't install webbot in my pc

please help me, i can't install this module.
I am using windows 10.
the error is
pip install webbot
Collecting webbot
Could not find a version that satisfies the requirement webbot (from versions: 0.0.1.win-amd64)
No matching distribution found for webbot
You are using pip version 18.1, however version 19.2.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

buymeacoffee.com setting looks wrong

I was going to support webbot with Buy me a coffee but I keep getting this message on the transaction error:
"This account isn't enabled to make cross border transactions. You can enable your account at dashboard.stripe.com/account/international"

thanks anyway!

permission error while init Browser()

I get permission error when i try to init Browser().

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> from webbot import Browser
>> Browser()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/webbot/webbot.py", line 45, in __init__
    os.chmod(driverpath , 0o755 ) 
PermissionError: [Errno 1] Operation not permitted: '/usr/local/lib/python3.5/dist-packages/webbox/drivers/chrome_linux'

how to do this.

i want the bot to wait for some time to do any time (like deplay).
any guide on it pls?

import error

I get this error when I whrite: from webbot import Browser

from webbot import browser
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\paulo\Desktop\webbot-master\webbot-master\webbot_init_.py", line 1, in
from .webbot import Browser
File "C:\Users\paulo\Desktop\webbot-master\webbot-master\webbot\webbot.py", line 42
def init(self , showWindow = True , proxy = None ):
^

TypeError: getaddrinfo() argument 1 must be string or None

after replacing chrome_linux with arm64 version I'm getting next issue:

Python 3.8.0 (default, Nov 19 2019, 12:46:48)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from webbot import Browser
>>> web = Browser()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.venv38/lib/python3.8/site-packages/webbot/webbot.py", line 52, in __init__
    self.driver = webdriver.Chrome(executable_path=driverpath , chrome_options=options)
  File "/.venv38/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 78, in __init__
    command_executor=ChromeRemoteConnection(
  File "/.venv38/lib/python3.8/site-packages/selenium/webdriver/chrome/remote_connection.py", line 24, in __init__
    RemoteConnection.__init__(self, remote_server_addr, keep_alive)
  File "/.venv38/lib/python3.8/site-packages/selenium/webdriver/remote/remote_connection.py", line 119, in __init__
    ip = common_utils.find_connectable_ip(parsed_url.hostname,
  File "/.venv38/lib/python3.8/site-packages/selenium/webdriver/common/utils.py", line 72, in find_connectable_ip
    connectable = is_connectable(port, sockaddr[0])
  File "/.venv38/lib/python3.8/site-packages/selenium/webdriver/common/utils.py", line 106, in is_connectable
    socket_ = socket.create_connection((host, port), 1)
  File "/usr/lib/python3.8/socket.py", line 787, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib/python3.8/socket.py", line 914, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
TypeError: getaddrinfo() argument 1 must be string or None

User Agent settings

Hello,
it would be nice having an option to change user agent when initializing a webdriver.

Can you please add it in next version?

My solution:

    class Browser:
    ...


    :__init__(showWindow = True , proxy = None, userAgent = None):
        ...
        :Args:
            - showWindow : If true , will run a headless browser without showing GUI window.
            - proxy : Url of any optional proxy server.
           - userAgent: userAgent string to be set for browser identification



    ....
    def __init__(self, showWindow=True, proxy=None , downloadPath:str=None, userAgent:str=None ):
        
        if userAgent:
            options.add_argument("user-agent={}".format(userAgent))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.