GithubHelp home page GithubHelp logo

theriley106 / sneakerbottutorials Goto Github PK

View Code? Open in Web Editor NEW
621.0 91.0 137.0 19.13 MB

Open Source SneakerBot created as a supplement to my "Creating a Sneaker Bot in Python" Youtube Series

Home Page: https://www.youtube.com/playlist?list=PL3fpqcQTK0f9sACDQstvjxbHzD1L_gr__

License: MIT License

Python 100.00%

sneakerbottutorials's Introduction

N|Solid

REVAMPING THE SNEAKER BOT (UPDATED 10/16/17)

Over the next month or so leading up to the release of the Semi-Frozen Yellow Yeezys I will be updating this repository with the bot I will be using to buy this shoe.

After the release I will create an update to my Youtube Series with a tutorial to reproduce the results.

Adding Proxies

The ability to add proxies from the command line has been added in the most recent commit.

Main.py will search system arguments for proxies.

Proxy input example:

$ python app.py 139.130.4.5:3226 131.150.1.5:4221

Which Proxies to Buy

N|Solid

N|Solid

To Do

  • Transfer Main.createHeadlessBrowser() headers to main.convertHeadless()

  • Add proxy to main.convertHeadless()

  • Add Updating Screenshot to index.html

  • Add box for "refresh rate" to index.html

  • Add some sort of timeout to PhantomJS & Firefox window

sneakerbottutorials's People

Contributors

jonbond009 avatar moose99 avatar theriley106 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  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

sneakerbottutorials's Issues

Error thrown copying cookies.

for cookie in cookies_list: 
     driver.add_cookie(cookie)

This will throw an error as you must be on a page matching the domain of the cookie in order to set it in the webdriver.

Fix by first visiting the splash page before attempting to change cookies.

# you can only set cookies for the driver's current domain so visit the page first then set cookies
driver.get(URL)
# precautionary - delete all cookies first
driver.delete_all_cookies()
for cookie in cookies_list:
     # precautionary - prevent possible Exception - can only add cookie for current domain
     if "adidas" in cookie['domain']:
          driver.add_cookie(cookie)
# once cookies are changed browser must be refreshed
driver.refresh()

PROXIES not defined

Hi all,

Just installed the sneakerbot, however im receiving the following error immediately following running the 'python app.py' command in terminal.

Haven't really messed around with it, looking for a quick solution if possible.

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Library/Python/2.7/site-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/developer/Desktop/SneakerBot/SneakerBotTutorials/app.py", line 132, in index
    info = massTestProxies(PROXIES)
NameError: global name 'PROXIES' is not defined

My fork will support Python3

BTW, I forked your repo and will keep it up to date for Python36 if anybody needs that.

If you have any further instructions on testing all the functionality, let me know. Currently I'm just running it and checking that the browser page works, but not much else.

Thanks

Python syntax error, line 72, main.py

I'm using python 36 and am getting this error on line 72 of main.py because "print exp" should be "print(exp)":

Encountered "exp" at line 72, column 10. Was expecting one of: <NEWLINE> ... "(" ... "[" ... ";" ... "," ... "." ... ":" ... "+" ... "-" ... "*" ... "/" ... "//" ... "<<" ... ">>" ... "%" ... "^" ... "|" ... "&" ... "=" ... ">" ... "<" ... "==" ... "<=" ... ">=" ... "!=" ... "+=" ... "-=" ... "*=" ... "@=" ... "/=" ... "//=" ... "%=" ... "&=" ... "|=" ... "^=" ... "<<=" ... ">>=" ... "**=" ... "or" ... "and" ... "not" ... "is" ... "in" ... "if" ... "@" ... ";" ... "," ... main.py /SneakerBotTutorials

ImportError: cannot import name flask

Traceback (most recent call last):
File "app.py", line 3, in
from flask import flask, render_template, request, url_for, redirect, Markup, jsonify, make_response, send_from_directory, session
ImportError: cannot import name flask

Flask is installed and im running on python2. Is there something else that I have done wrong?

Question

What license are you using for this open source project?

ImportError: No module named html.entities

Traceback (most recent call last):
File "app.py", line 6, in
import bs4
File "D:\Program Files\Python\lib\site-packages\bs4_init_.py", line 35, in
from .builder import builder_registry, ParserRejectedMarkup
File "D:\Program Files\Python\lib\site-packages\bs4\builder_init_.py", line 7, in
from bs4.element import (
File "D:\Program Files\Python\lib\site-packages\bs4\element.py", line 10, in
from bs4.dammit import EntitySubstitution
File "D:\Program Files\Python\lib\site-packages\bs4\dammit.py", line 14, in
from html.entities import codepoint2name
ImportError: No module named html.entities

This is what I am receiving when I input the command, "python app.py"
P.S. I do not have that much coding background, I looked everywhere too find the solution but can't find anything

no module named flask

after entering "python app.py", confirming that i am using python version 2.x

terminal shows:
"Traceback (most recent call last):
File "app.py", line 3, in
from flask import Flask, render_template, request, url_for, redirect, Markup, jsonify, make_response, send_from_directory, session
ImportError: No module named flask"

I can't edit the code. What should I do?

Detection?

Hi, how does this bot get past automation detection by Distil networks etc? Most sneaker sites have this installed

Recent update wont run app.py

After the most recent update, when i try to run app.py I am getting an error. I have pasted the terminal output in this message.

Traceback (most recent call last):
  File "app.py", line 15, in <module>
    bot = main.bot({})
  File "/Users/stevesahayadarlin/Desktop/YeezyBot/SneakerBotTutorials-master/main.py", line 43, in __init__
    self.driver = webdriver.PhantomJS(service_args=['--proxy={}'.format(proxy), '--proxy-type=http'])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 52, in __init__
    self.service.start()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 71, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH. 

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service object at 0x10364b6d0>> ignored

Adidas splash page rejects most user agent's.

If you take a screenshot after a task has started and put in the actual splash page, many of them give an error saying that the current browser is "not currently supported" and to "update to a modern browser". This is due to the user agents being outdated.

UnboundLocalError: local variable 'info' referenced before assignment

I cloned the latest project and I am able to run the app.py. I made sure to change the BeautifulSoup so that it uses an html parser. However, after making those changes I am getting an error that says UnboundLocalError: local variable 'info' referenced before assignment. Is there a problem with the code or am I doing something wrong?

Ran testingCookies.py, but it's not working.

Traceback (most recent call last): File "testingCookies.py", line 32, in <module> new = convertHeadless(driver, 'https://www.amazon.com/gp/cart/view.html/ref=nav_cart') File "testingCookies.py", line 17, in convertHeadless driver = webdriver.Firefox() File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 80, in __init__ self.binary, timeout) File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__ self.binary.launch_browser(self.profile, timeout=timeout) File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser self._wait_until_connectable(timeout=timeout) File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 108, in _wait_until_connectable % (self.profile.path)) selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: /var/folders/97/bfdl_fwn65nf6z35426y91s40000gp/T/tmp3EknVq If you specified a log_file in the FirefoxBinary constructor, check it for details.

Any ideas where i might have gone wrong?

Unable to find element by ID

I dont get it. I'm running this in a virtualenv. Pulling all of your requirements, etc... Yet im still getting errors. Initially when running it, it opens but doesnt pull up Amazon. I set the geckodriver.exe executable path and now im getting an error saying its not finding the element by id....

Traceback (most recent call last): File "testingCookies.py", line 29, in <module> driver.find_element_by_id("add-to-cart-button").click() File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in find_element_by_id return self.find_element(by=By.ID, value=id_) File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element 'value': value})['value'] File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/Users/developer/Desktop/SneakerBot/venv/yeezy2/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with id 'add-to-cart-button'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"99","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:54525","User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{\"using\": \"id\", \"sessionId\": \"c111fa40-e19f-11e7-9e15-6b2466416670\", \"value\": \"add-to-cart-button\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/c111fa40-e19f-11e7-9e15-6b2466416670/element"}} Screenshot: available via screen

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.