Giter Site home page Giter Site logo

metamask_bf's People

Contributors

yuta-belmont 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

Watchers

 avatar  avatar  avatar  avatar

metamask_bf's Issues

s

hi in which app can i run the code

Useless code

line 12, in
opt.add_extension(EXTENSION_PATH)
File "C:\Users\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\chromium\options.py", line 103, in add_extension
raise ValueError("argument can not be null")
ValueError: argument can not be null

Not able to run

C:\Users\[Myname]\Desktop\metamask_bf-main>metamask_bf_v2.py
  File "C:\Users\[Myname]\Desktop\metamask_bf-main\metamask_bf_v2.py", line 9
    EXTENSION_PATH = "C:\Users\[Myname]\AppData\Local\Google\Chrome\User Data\Default\Extensions\nkbihfbeogaeaoehlefnkodbefgpgknn\10.13.0_0.crx" #enter the path to your .crx file here
                                                                                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

I have put the extension path correctly

many errors

image
image
Chrome and Driver version 100
python version 3.1.4

Doesn't find elements with latest version of selenium

Please mention which version of Selenium you use to run this code because the new version raises many issues. One major issue is that the Chrome browser window closes right after the window is open,

Fixed the above-mentioned issue by following the code:

opt.add_experimental_option("detach", True) # add this line to fix window closing issue
driver = webdriver.Chrome(executable_path=path_to_chromedriver, options=opt)

But still, the selenium is unable to find elements. Please check and create the code for the recent Selenium version.

I have a problem with my PC, can you help me? I am using metamask_bf_v2.py

DevTools listening on ws://127.0.0.1:51259/devtools/browser/9b92077b-9960-4c46-80c9-d8eab423bfdd
START: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] ['xxx', 'xxxx', 'xxxx', 'xxxx', 'xxxx', 'xxxx', 'xxx', 'xxxx', 'xxxx', 'xxxx', 'xx', 'xxxx']
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\metamask_bf_v2\metamask_bf_v2\metamask_bf_v2.py", line 64, in
driver.find_element(by = By.CSS_SELECTOR, value = '#app-content > div > div.main-container-wrapper > div > div > div > form > div.import-srp__container > div.actionable-message.actionable-message--danger.import-srp__srp-error.actionable-message--with-icon') #check to see if invalid message pops up
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 855, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in execute
self.error_handler.check_response(response)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"#app-content > div > div.main-container-wrapper > div > div > div > form > div.import-srp__container > div.actionable-message.actionable-message--danger.import-srp__srp-error.actionable-message--with-icon"}
(Session info: chrome=105.0.5195.102)
Stacktrace:
Backtrace:
Ordinal0 [0x0054DF13+2219795]
Ordinal0 [0x004E2841+1779777]
Ordinal0 [0x003F423D+803389]
Ordinal0 [0x00423025+995365]
Ordinal0 [0x004231EB+995819]
Ordinal0 [0x00450F52+1183570]
Ordinal0 [0x0043E844+1108036]
Ordinal0 [0x0044F192+1175954]
Ordinal0 [0x0043E616+1107478]
Ordinal0 [0x00417F89+950153]
Ordinal0 [0x00418F56+954198]
GetHandleVerifier [0x00842CB2+3040210]
GetHandleVerifier [0x00832BB4+2974420]
GetHandleVerifier [0x005E6A0A+565546]
GetHandleVerifier [0x005E5680+560544]
Ordinal0 [0x004E9A5C+1808988]
Ordinal0 [0x004EE3A8+1827752]
Ordinal0 [0x004EE495+1827989]
Ordinal0 [0x004F80A4+1867940]
BaseThreadInitThunk [0x771EFA29+25]
RtlGetAppContainerNamedObjectPath [0x77D47A7E+286]
RtlGetAppContainerNamedObjectPath [0x77D47A4E+238]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\metamask_bf_v2\metamask_bf_v2\metamask_bf_v2.py", line 97, in
elem = driver.find_element(by = By.XPATH, value = '/html/body/div[1]/div/div[3]/div/div/div/div[2]/div/div[1]/div/div/div/div[2]/span[1]') #find balance element
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 855, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in execute
self.error_handler.check_response(response)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div[3]/div/div/div/div[2]/div/div[1]/div/div/div/div[2]/span[1]"}
(Session info: chrome=105.0.5195.102)
Stacktrace:
Backtrace:
Ordinal0 [0x0054DF13+2219795]
Ordinal0 [0x004E2841+1779777]
Ordinal0 [0x003F423D+803389]
Ordinal0 [0x00423025+995365]
Ordinal0 [0x004231EB+995819]
Ordinal0 [0x00450F52+1183570]
Ordinal0 [0x0043E844+1108036]
Ordinal0 [0x0044F192+1175954]
Ordinal0 [0x0043E616+1107478]
Ordinal0 [0x00417F89+950153]
Ordinal0 [0x00418F56+954198]
GetHandleVerifier [0x00842CB2+3040210]
GetHandleVerifier [0x00832BB4+2974420]
GetHandleVerifier [0x005E6A0A+565546]
GetHandleVerifier [0x005E5680+560544]
Ordinal0 [0x004E9A5C+1808988]
Ordinal0 [0x004EE3A8+1827752]
Ordinal0 [0x004EE495+1827989]
Ordinal0 [0x004F80A4+1867940]
BaseThreadInitThunk [0x771EFA29+25]
RtlGetAppContainerNamedObjectPath [0x77D47A7E+286]
RtlGetAppContainerNamedObjectPath [0x77D47A4E+238]

Press any key to continue . . . [9064:1716:0907/200053.954:ERROR:device_event_log_impl.cc(214)] [20:00:53.955] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.

Keeps opening guest chrome

Every time I try to run it it opens a new guest chrome so there is no metamask on it and I cant download because it wont save it

Outdate

Ausnahme: NoSuchElementException
Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div/div[3]/div/div/div/div[2]/div/div[1]/div/div/div/div[2]/span[1]"}
(Session info: chrome=102.0.5005.27)
Stacktrace:
Backtrace:
Ordinal0 [0x00422733+2434867]
Ordinal0 [0x003B07A1+1968033]
Ordinal0 [0x0029C678+837240]
Ordinal0 [0x002C94E0+1021152]
Ordinal0 [0x002C977B+1021819]
Ordinal0 [0x002F6592+1205650]
Ordinal0 [0x002E4484+1131652]
Ordinal0 [0x002F4892+1198226]
Ordinal0 [0x002E4256+1131094]
Ordinal0 [0x002BE840+976960]
Ordinal0 [0x002BF736+980790]
GetHandleVerifier [0x00693C72+2515426]
GetHandleVerifier [0x0068702F+2463135]
GetHandleVerifier [0x004C522A+620442]
GetHandleVerifier [0x004C4016+615814]
Ordinal0 [0x003B707B+1994875]
Ordinal0 [0x003BB938+2013496]
Ordinal0 [0x003BBA25+2013733]
Ordinal0 [0x003C4DE1+2051553]
BaseThreadInitThunk [0x754EFA29+25]
RtlGetAppContainerNamedObjectPath [0x77207A7E+286]
RtlGetAppContainerNamedObjectPath [0x77207A4E+238]
File "C:\Users\admin\Desktop\metamask_bf-main\metamask_bf_v2.py", line 57, in
driver.find_element(by = By.CSS_SELECTOR, value = '#app-content > div > div.main-container-wrapper > div > div > div > form > div.import-srp__container > div.actionable-message.actionable-message--danger.import-srp__srp-error.actionable-message--with-icon') #check to see if invalid message pops up

During handling of the above exception, another exception occurred:

File "C:\Users\admin\Desktop\metamask_bf-main\metamask_bf_v2.py", line 85, in
elem = driver.find_element(by = By.XPATH, value = '/html/body/div[1]/div/div[3]/div/div/div/div[2]/div/div[1]/div/div/div/div[2]/span[1]') #find balance element

DeprecationWarning: executable_path has been deprecated, please pass in a Service object

C:\1\metamask_bf_v2.py:17: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Chrome(executable_path=chrome_driver_path)

DevTools listening on ws://127.0.0.1:62093/devtools/browser/731feb26-f12c-4957-a36a-c528d7a31033
Traceback (most recent call last):
File "C:\1\metamask_bf_v2.py", line 17, in
driver = webdriver.Chrome(executable_path=chrome_driver_path)
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in init
super().init(DesiredCapabilities.CHROME['browserName'], "goog",
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 92, in init
super().init(
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 272, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 364, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 106
Current browser version is 105.0.5195.127 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
Ordinal0 [0x01091ED3+2236115]
Ordinal0 [0x010292F1+1807089]
Ordinal0 [0x00F366FD+812797]
Ordinal0 [0x00F58C6D+953453]
Ordinal0 [0x00F54200+934400]
Ordinal0 [0x00F519C9+924105]
Ordinal0 [0x00F8806C+1146988]
Ordinal0 [0x00F87A6A+1145450]
Ordinal0 [0x00F818A6+1120422]
Ordinal0 [0x00F5A73D+960317]
Ordinal0 [0x00F5B71F+964383]
GetHandleVerifier [0x0133E7E2+2743074]
GetHandleVerifier [0x013308D4+2685972]
GetHandleVerifier [0x01122BAA+532202]
GetHandleVerifier [0x01121990+527568]
Ordinal0 [0x0103080C+1837068]
Ordinal0 [0x01034CD8+1854680]
Ordinal0 [0x01034DC5+1854917]
Ordinal0 [0x0103ED64+1895780]
BaseThreadInitThunk [0x77A56739+25]
RtlGetFullPathName_UEx [0x77D38FD2+1218]
RtlGetFullPathName_UEx [0x77D38F9D+1165]

DeprecationWarning: use options instead of chrome_options

C:\1>metamask_bf_v1.py
C:\1\metamask_bf_v1.py:43: DeprecationWarning: use options instead of chrome_options
driver = webdriver.Chrome(chrome_options=opt)
Traceback (most recent call last):
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\1\metamask_bf_v1.py", line 43, in
driver = webdriver.Chrome(chrome_options=opt)
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 69, in init
super().init(DesiredCapabilities.CHROME['browserName'], "goog",
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 89, in init
self.service.start()
File "C:\Users\iheb\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

Error

Warning (from warnings module):
File "C:\Users\romka\OneDrive\Робочий стіл\1.py", line 11
driver = webdriver.Chrome(chrome_options=opt)
DeprecationWarning: use options instead of chrome_options
Traceback (most recent call last):
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
creationflags=self.creationflags)
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 800, in init
restore_signals, start_new_session)
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\romka\OneDrive\Робочий стіл\1.py", line 11, in
driver = webdriver.Chrome(chrome_options=opt)
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init
service_log_path, service, keep_alive)
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 89, in init
self.service.start()
File "C:\Users\romka\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

what i must to do?

MetaMask changed the User Interface

new interface

This code doesn't work anymore as the Meta Mask user interface is changed. New elements need to be found through the selenium and then we can run the remaining function. Please create code for the updated UI.

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.