I am facing an interesting problem ( which unfortunately i am unable to find a solution for) and that’s why i am requesting help from the beautiful minds over here.
I am building a web scraper for YouTube ( no api or anything because #costs).
Currently my robot goes on YouTube, searches by some keywords and filters by upload date and then takes the number of views of the videos on the page. Then it trims the string and transforms it into an INT.
The problem is that the views on YouTube after 999 go to 1K/1.1K/1.2K and so on. I have already fixed an exception where some videos have no views and i iffed that out. Long story short what i would need guidance on is, i need to transform/multiply that string and remove the K at the end and then transform the variable float (1.2) in 1200 in order to convert it to string.
As you can see in the if where i wrote the OR i have no idea how to transform it.
Please let me know if it makes sense what i tried to explain.
** i have no idea how to attach screenshots while creating the topic
** found it
Thank you for the quick answer Yoichi, it works like a charm (on a test file).
But i do have a question though and forgive me if it sounds stupid but, given that i have one single variable for the number of views ( views_number ) which pulls from 1 view to 1K /1M/1B and i have the exception if ( if the string = “No views” then do nothing ) , how can i integrate that into my IF?
Also, is there any reason why i am unable to assign the Double Parse?
And it seems to be working just fine. thank so so very much! i will mark you answer as a solution, but can i post more questions here if i have later on ?
Yes, but if your additional question is far from the title, perhaps you should create another topic, i think. (And someone (include me) will reply it.)