Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not pulling data from prizepicks #12

Open
ezequiel-kl opened this issue Mar 15, 2024 · 4 comments
Open

Not pulling data from prizepicks #12

ezequiel-kl opened this issue Mar 15, 2024 · 4 comments
Labels
question Further information is requested

Comments

@ezequiel-kl
Copy link

Hey, your project is wonderful, I was having this error while starting the app:
image

I went to the API link that you left on the code and proceed to manually copy and paste that info into the pre_formatted_projections.json file and then it successfully started:

image

Is this expected? I am missing something or the format changed?

Thank you for this development, I was trying to do something similar but this is awesome.

@KevinTrinh1227
Copy link
Owner

KevinTrinh1227 commented Mar 15, 2024

Hello @ezequiel-kl,

Thank you for reaching out! So the way I designed it to work is that it uses a web driver to "hard scrape" the API from Prize Picks.

Yes, that is the expected output to terminal. I have not yet implemented a system to search up players with a full name more than 2 words, or special characters yet. (Working as a revamped version 2 // full stack as of this moment)

But if you're asking if users are supposed to copy and paste the API info, then no. Technically it works, but I have it to where it uses a web driver instead.

Why would I do this rather than just making a normal API request you may ask? Because Prize Picks does not allow public API, nor do I have an Auth key. While you can copy and paste from the link (which was how I used to have it before LOL) It was now the ideal method I wanted so I used a web driver to open a Firefox tab locally on your computer to web scrape all the API data into the JSON file.

So after you start it it should open a FireFox tab assuming you have FireFox and gecko which is installed on your system...
image

It will scrape all the prize picks data and put it in the JSON (this was for debugging/testing purposes) then it will start searching up players, etc.

image

And it will display...
image

@KevinTrinh1227 KevinTrinh1227 added the question Further information is requested label Mar 15, 2024
@ezequiel-kl
Copy link
Author

Thank you for your fast reply!

That is exactly what is trying to do but when it opens the Firefox tab, I see that it shows the data, and after this window:

image

It immediately closes and throws the error that I showed on my initial post

So I opened the link, created an empty pre_formatted_projections.json and copied the content manually to the file and it worked as you show me on your screenshots.

Tomorrow with the new predictions I will now if I "accidentally" fixed the issue.

Thank you for your support, I really appreciate it.

@KevinTrinh1227
Copy link
Owner

KevinTrinh1227 commented Mar 15, 2024

Hmm im not sure why it's doing that.

Try adding this line of code in the for loop:

print(type(item)) 

Inside the ./utils/json_parser.py...
image

It should be a bunch of dictionaries. And it should print a bunch of <class 'dict'>s

@ezequiel-kl
Copy link
Author

Hey man that worked!

Thank you a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants