Great video, very clear. Please make a video on roadmap to learning python from scratch, specifically for stock analysis, chart analysis, getting trade signals using charts and statistical analysis of stocks. I mean create a roadmap on the course tailored cut for only stock analysis . Regards Farid
Otherwise this also works - My(6px) Pos(r) smartphone_Mt(6px) W(100%). I noticed the class ID currently on the page today is slightly different from what we have in the video.
@eMasterClassAcademy can you please share the jupyter notebook of this video ? for somereason the copy pasted class code from inspect of Yahoo page is not working correctly for me. I would like to refer to your code and find where I am going wrong
Thanks for watching Eric. For historical data, I am using polygon.ai to download. Details can’t be found in lesson 8 in this series- ruclips.net/video/IfUR1XJaMcg/видео.html
Hi, I tried this code, however I got [ ], [ ] as output for NSE stock. Is there anything that I need to change in code for Indian Stocks?. Please advise. Thanks.
Hi Mahendra, thanks for watching the series. Since Yahoo has updated its html at the back end, if you still would like to use Beautifulsoup to capture the data, you need to change a bit of the code. Please see the updates from #17-18 ruclips.net/video/A9Rj77CKpJ8/видео.html However, I would also recommend to use Selenium which is more stable (but slower). Please also see the updates from #19-21 ruclips.net/video/-UVvcONNt80/видео.html Here I assumed Yahoo has stock data for India. Hope it helps.
This no longer works (it loops [] [] [] []). I wonder WHY does this need to be updated for stocks. For example, you made a previous video with different code. Why does it have to change over time?
I cannot seem to find the error as I have check all syntax over and over vs yours but I keep getting this error when I try to run it: Traceback (most recent call last): line 44, in print(real_time_price('BRK-B')) line 33, in real_time_price price, change = texts[0], texts[1] TypeError: 'NoneType' object is not subscriptable
@@pucek365 tried and still got the same error here :( line 38, in print(real_time_price('BRK-B')) line 25, in real_time_price price = texts[0] TypeError: 'NoneType' object is not subscriptable
I figured it out I had a unnecessary space in the return function: def web_content_div(web_content, class_path): web_content_div = web_content.find_all('div', {'class': class_path}) try: spans = web_content_div[0].find_all('span') texts = [span.get_text() for span in spans] except IndexError: texts = [] *****(space that was not supposed to be here) return texts
so i tried scraping tesla and its not a span its a fin streamer, and the percent change is 2 seperate elements. this did not work.....thankfully gpt4 wrote the code for me........
any Idea why pd.to_excel overwrites the first row over and over again? I've tried it with pd.to_csv but when I use transpose() it starts writing all the info in the first column and doesn't come to the next.
For some reason, my code only returns the price change and percent change and doesn't include the current price. How can I fix this? please post a link to source code
Ok, here's the answer. Basically yahoo finance changed their html code. I had to look back through it, but the 'span' class which we are searching through is only used for displaying the price change and percent change. The easy fix is to change the line spans = web_content_div[0].find_all('span') to spans = web_content_div[0].find_all('fin-streamer'). If you make that change and run it, it will return the price and price change, because you are only looking for the first two bits of data. If you also want the price change you have to add a third array [], so rather than price, change = [], [] you have to make it price, change, pct = [], [], [] for every line where you see that.
When I do this the spacing in the web_content_div(web_content, '' ') bit stops me from printing out the price, it only allows me to do the percentage change? Is there anyway around this. If i use that full smartphone bit i get nothing
Hi Eeshan, thanks for your questions. This is indeed one of the projects in my plan. Although it is not yet out, it's not difficult to do so as long as you can have enough target data (e.g. minutes data of certain stock / index / option) for simulation. 1) For data, here is a video to show how we can retrieve 2 years of data at 1 min interval - ruclips.net/video/IfUR1XJaMcg/видео.html 2) For backtesting, you can find details from python #8 - #16 - ruclips.net/video/kWmwcQIcULU/видео.html 3) For simulation, you can follow the lessons #22 - #29 - ruclips.net/video/cVntWP3__Mw/видео.html and simply change this line of code: filename = str(time_stamp) + ' stock data.csv' At the same time, you need to create a separate py. program which appends the data one by one from the data retrieved by 1) in a csv with filename in 3). Hope it helps. Let me create a video to show you how to create a separate program for appending data in a defined csv file later.
You need to check if you retrieve something from the “div” content first. If yes, then you can find out the “span” that capture the required data. If not, then the “div” doesn’t return you any values. You might need to switch to other “div” or find other sources. Make sure there is no typo. Happy web scraping!
@@eMasterClassAcademy i used `'My(6px)'` as the path and it worked. can you explain why? also can i get any of your social media handle to follow and chat you up sir.
idk why it's so hard to follow along with this guy, like he is just coding, instead of trying to teach. Take step back explain what you are making and explain your var names!!
Hey man I'm now too. The first part is make sure in your virtual environment you have the right packages installed.... So basically file new project.... You are basically making a new environment that is blank... then when you get in pycharm to a text editor look near the bottom.. there is "python packages". you have to install all the packages he uses like pandas, beautiful soup, requests etc. from there make sure you "configuration" is set up to the file you are currently working on or basically you cant run anything in pycharm.... Kind of stupid how that works, but if you get that set up right, now your fishin with Dynamite brotha!
definetly the best starter video for python for finance! thanks
Great video, very clear.
Please make a video on roadmap to learning python from scratch, specifically for stock analysis, chart analysis, getting trade signals using charts and statistical analysis of stocks. I mean create a roadmap on the course tailored cut for only stock analysis .
Regards
Farid
Otherwise this also works - My(6px) Pos(r) smartphone_Mt(6px) W(100%). I noticed the class ID currently on the page today is slightly different from what we have in the video.
Excited to see more! Thanks
Looking forward to seeing more! Thanks you sir!
Great content! Can you please provide the source code for entire project?
Thank God, the Devil or the Light (which ever your into) for this tutorial series amazing content to share thank you so much...
Excellent, thanks for sharing
Thanks for watching!
Looks very nice the setting. Thanks!
I'm more into C++ Builder and Delphi. I got a library to make connections to IB. I plan to connect to alpaca in the future
nice one, thanks
how did you even know how to do this? brilliant tutorial.
@eMasterClassAcademy can you please share the jupyter notebook of this video ? for somereason the copy pasted class code from inspect of Yahoo page is not working correctly for me. I would like to refer to your code and find where I am going wrong
Thank you so much for this tutorial!
Great video! thanks! :D
Thank you too!
does the code work for you ? I think Yahoo finance made some change on the div class since this video is post. please let me know
Yes, exactly
@@messymagic1373 Hey were you able to figure out the div class?
@@fdrakr101 He made an updated video, check that out.
Great video for parsing real time data off a website.
How and where would you extract old stock prices from yesterday, last month or last year?
Thanks for watching Eric.
For historical data, I am using polygon.ai to download.
Details can’t be found in lesson 8 in this series- ruclips.net/video/IfUR1XJaMcg/видео.html
Thanks a lot. Are you going to do any prediction?
I am so happy about this .I just received a transfer of 38000usd all thanks to thechinahacks
ignore all scams of this kind please. there is no easy/guaranteed money
guys i get this thing ([], [])
what should i do
Hi, I tried this code, however I got [ ], [ ] as output for NSE stock. Is there anything that I need to change in code for Indian Stocks?. Please advise. Thanks.
Hi Mahendra, thanks for watching the series.
Since Yahoo has updated its html at the back end, if you still would like to use Beautifulsoup to capture the data, you need to change a bit of the code. Please see the updates from #17-18 ruclips.net/video/A9Rj77CKpJ8/видео.html
However, I would also recommend to use Selenium which is more stable (but slower). Please also see the updates from #19-21 ruclips.net/video/-UVvcONNt80/видео.html
Here I assumed Yahoo has stock data for India. Hope it helps.
Would it be possible to link the GitHub repo for this?
This no longer works (it loops [] [] [] []). I wonder WHY does this need to be updated for stocks. For example, you made a previous video with different code. Why does it have to change over time?
I cannot seem to find the error as I have check all syntax over and over vs yours but I keep getting this error when I try to run it:
Traceback (most recent call last):
line 44, in
print(real_time_price('BRK-B'))
line 33, in real_time_price
price, change = texts[0], texts[1]
TypeError: 'NoneType' object is not subscriptable
Try this block of code:
if texts != []:
price = texts[0]
change = texts[1]
return price, change
Instead what is in video if you are still interested
@@pucek365 tried and still got the same error here :(
line 38, in
print(real_time_price('BRK-B'))
line 25, in real_time_price
price = texts[0]
TypeError: 'NoneType' object is not subscriptable
I figured it out
I had a unnecessary space in the return function:
def web_content_div(web_content, class_path):
web_content_div = web_content.find_all('div', {'class': class_path})
try:
spans = web_content_div[0].find_all('span')
texts = [span.get_text() for span in spans]
except IndexError:
texts = []
*****(space that was not supposed to be here) return texts
Just tried this out and was only able to return the data when using 'My(6px)' instead of what's in the video
can u do on indian NSE stock market ?
bro make a video on intraday moneyflow analysis of future and option
Thx!
Yahoo Finance data is showing, but the values are incorrect. What to do?
I don't why but connectionEroor and requestsexcpetion it is showing these modules are not found
its not reading the first span. It´s always jumping for the next. In resume its reading only the change, not the price.
Hi, im getting SyntaxError: unexpected EOF while parsing issue while executing the file. please help
so i tried scraping tesla and its not a span its a fin streamer, and the percent change is 2 seperate elements. this did not work.....thankfully gpt4 wrote the code for me........
any Idea why pd.to_excel overwrites the first row over and over again?
I've tried it with pd.to_csv but when I use transpose() it starts writing all the info in the first column and doesn't come to the next.
cannot find the element in the url how to solve that problem??
i am not able to copy this inspect element path how i can please help me
For some reason, my code only returns the price change and percent change and doesn't include the current price. How can I fix this? please post a link to source code
same issue
Ok, here's the answer. Basically yahoo finance changed their html code. I had to look back through it, but the 'span' class which we are searching through is only used for displaying the price change and percent change. The easy fix is to change the line spans = web_content_div[0].find_all('span') to spans = web_content_div[0].find_all('fin-streamer'). If you make that change and run it, it will return the price and price change, because you are only looking for the first two bits of data. If you also want the price change you have to add a third array [], so rather than price, change = [], [] you have to make it price, change, pct = [], [], [] for every line where you see that.
@@martinwendling6673 see my reply to OP
@@jameskaddissi6600 😀
@@jameskaddissi6600 thank you so much for this. I was struggling to get this working.
Is center pivot point included
('-0.81', '(-0.26%) mine is just showd this. how to show price
Could you share the code file?
How did you do live plotting?
How to get for India NSE data
I give up. do i need a different version of python ?? I am using 3.8.1
i think site is updated [it do not allow web scraping] not working for me bro . if it is working for u please send me the code
@@saharamanson1970 It is scrapable by other means but I keep getting no values returned using this method
@@andrewsnowdon2845 I have the same problem
the yahoo fin page does not have a span around the data, its now a class.
We are from India so what time stamp would we insert
When I do this the spacing in the web_content_div(web_content, '' ') bit stops me from printing out the price, it only allows me to do the percentage change? Is there anyway around this. If i use that full smartphone bit i get nothing
string sorry lol
How did you resolve the problem?
How do we get different time frames
couldn't you use the yfinance api ?
Awesome content ! would like to know how frequent can I access the data, whether yahoo will detect as bot and ban my IP?
Can somebody who has it working just give me the code. I don't understand what to copy and past because he just kind of did it.
Hong Kong 您好,我是來自台灣STEVEN 能否轉帳給你得到你的原始碼, 謝謝
你好, 所有原始碼都提供給這頻道RUclips 會員 (級別2或以上).
希望幫助到你.
BRO CAN I GET THE SOURCE CODE
Source code available?
Thanks for watching.
Code and materials are available to members (level 2 or 3).
Do you have anything regarding stock option simulator thing?
Hi Eeshan, thanks for your questions.
This is indeed one of the projects in my plan. Although it is not yet out, it's not difficult to do so as long as you can have enough target data (e.g. minutes data of certain stock / index / option) for simulation.
1) For data, here is a video to show how we can retrieve 2 years of data at 1 min interval - ruclips.net/video/IfUR1XJaMcg/видео.html
2) For backtesting, you can find details from python #8 - #16 - ruclips.net/video/kWmwcQIcULU/видео.html
3) For simulation, you can follow the lessons #22 - #29 - ruclips.net/video/cVntWP3__Mw/видео.html and simply change this line of code:
filename = str(time_stamp) + ' stock data.csv'
At the same time, you need to create a separate py. program which appends the data one by one from the data retrieved by 1) in a csv with filename in 3).
Hope it helps.
Let me create a video to show you how to create a separate program for appending data in a defined csv file later.
@@eMasterClassAcademy thanks a lot this help a loads
can anyone help my source code returns and empty [] []
You need to check if you retrieve something from the “div” content first.
If yes, then you can find out the “span” that capture the required data.
If not, then the “div” doesn’t return you any values. You might need to switch to other “div” or find other sources. Make sure there is no typo.
Happy web scraping!
@@eMasterClassAcademy i used `'My(6px)'` as the path and it worked. can you explain why?
also can i get any of your social media handle to follow and chat you up sir.
@@eMasterClassAcademy Also my results looks this `('-4.61', '(-1.43%)') `is that ok?
@@isaacshadrach7683 Yeah It wasn't working for me then I tried it as 'My(6px)" and it just worked
Did you fix that? I have same issue with empty( [ ], [ ] )
Que hpta video tan melo
more important are open, high, volume, .... in interval such as 5 min, 15 min, .... this is basically useless
idk why it's so hard to follow along with this guy, like he is just coding, instead of trying to teach. Take step back explain what you are making and explain your var names!!
Vro did u get any typeerror
Hi, thanks for the video. How do I set up PyCharm the way you have sr?
Hey man I'm now too. The first part is make sure in your virtual environment you have the right packages installed.... So basically file new project.... You are basically making a new environment that is blank... then when you get in pycharm to a text editor look near the bottom.. there is "python packages". you have to install all the packages he uses like pandas, beautiful soup, requests etc. from there make sure you "configuration" is set up to the file you are currently working on or basically you cant run anything in pycharm.... Kind of stupid how that works, but if you get that set up right, now your fishin with Dynamite brotha!