wcrasta / ESPN-Fantasy-Basketball

Free Fantasy Basketball tools for ESPN Leagues
https://espnfantasy.warrencrasta.com
MIT License
32 stars 15 forks source link

Problem when pulling data locally #7

Closed martendt closed 5 years ago

martendt commented 5 years ago

Hey guys,

I really appreciate your work, and all the effort you've put into it! So my issue is related to testing the code on my local machine. Simply testing the code (by commenting out the main statement, and uncommenting the lines below it) runs smoothly with no errors, but returns empty lists - no data. However, when I use the same url in your website, which uses the same code, it seems to work fine. Do you have any ideas on what could be causing the problem?

martendt commented 5 years ago

Upon examining further - I am using python 3.6.6 - could this be the issue? I see you are using 3.5.2.

wcrasta commented 5 years ago

Hey, thanks for your comment. I’m on mobile so I apologize for any formatting issues in this comment. I’ll explain what I think is the problem and if it doesn’t fix things, I’ll provide a code snippet when I’m on desktop.

I suspect the error is due to chromedriver. I made some changes recently and forgot to update the README to provide installation details. What you can do is put a “try” at the start of the setup() method and an “except Exception as ex: print(ex) at the end of the setup() method and the run code. Let me know what the error says.

In regards to getting Chromedriver working, download it from the chromedriver website. If you’re using virtualenv (which you should be), put it in the bin folder if you’re on Mac or the Scripts folder if you’re on Windows.

Please let me know what the exception says and I can help you out further.

martendt commented 5 years ago

So - chromedriver definitely WAS an error before I posted this - I had an error which wouldn't make it running through setup() method, and I was able to figure it out enough to install chromedriver.exe in the correct place, and add it to the system path. Now, I don't get any error when running it - it just spits out empty lists instead of the correct team stats, etc.

I have not used a virtualenv in this case, and so right now I"m going to see if I can set that up with python 3.5.2, if it fixes the problem. (I haven't set up a virtualenv before, so I have to figure out how to do it).

martendt commented 5 years ago

I've set up an environment for 3.5.2, and I'm still getting the same problem - although I'm getting an error as well as an empty list: [numbers...:ERROR: gpu_proces_transport_factory.cc(1007)] Lost UI shared context.

Then an empty list is returned.

wcrasta commented 5 years ago

What I'd recommend doing is using a debugger in your IDE to figure out the issue. I personally prefer PyCharm. Comment out the line where I add the "headless" argument to Chromedriver and it should launch a Chrome instance on your machine. Put a breakpoint somewhere and keep stepping + comparing it with what you see in Chrome. Let me know which line is giving you the empty list.