0

I am trying to access a website and run an instance of Selenium Webdriver (chromedriver to be exact) in order to automate/perform some actions (I'm creating an autocheckout bot that can find a product and will automatically purchase it).

pagesDict = {'base': 'http://www.supremenewyork.com/',
                 'tops/sweaters': 'http://www.supremenewyork.com/shop/all/tops_sweaters',
                 'jackets': 'http://www.supremenewyork.com/shop/all/jackets',
                 'shirts': 'http://www.supremenewyork.com/shop/all/shirts',
                 'sweatshirts': 'http://www.supremenewyork.com/shop/all/sweatshirts',
                 'pants': 'http://www.supremenewyork.com/shop/all/pants',
                 'shorts': 'http://www.supremenewyork.com/shop/all/shorts',
                 'hats': 'http://www.supremenewyork.com/shop/all/hats',
                 'bags': 'http://www.supremenewyork.com/shop/all/bags',
                 'skate': 'http://www.supremenewyork.com/shop/all/skate',
                 't-shirts': 'http://www.supremenewyork.com/shop/all/t-shirts'}

category = input("Category:\n   Available options:\n        shirts, jackets, tops/sweaters, sweatshirts, pants, shorts, hats, accessories, skate")
sauce = urllib.request.urlopen(pagesDict[category])
soup = bs.BeautifulSoup(sauce, 'lxml')

For some reason, when I run my bot on a different network than my home one (such as work or school), the code runs fine. However, when I run it on my desktop at home, I get 403 error, and the page will not load 90% of the time. However, with a DNS flush, release, and renew will usually fix the problem for the next run (ONLY ONE). Then, it will continue to stop loading my pages.

Is this a problem with Selenium, or how my network settings are configured? L

1

If you are using the same code on multiple networks, and it's working on Network A but not on Network B, then it's the network settings.

Seeing as the issue is then resolved temporarily by running the DNS flush, release, and renew, then this essentially proves it's network related.

I'd recommend trying to run these tests via a proxy, and if that doesn't work, raising a question on Network Engineering for further networking advice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy