chris-greening/instascrape

Examples

chris-greening opened this issue ยท 16 comments

Provide simple and/or complex examples showcasing the different ways you can use instascrape.

Jupyter Notebooks explaining your examples in detail are encouraged but not required!

I guess I could give this a shot...

I can provide some examples too :D

Working on converting that CSV example to IPython

Then getting to an actual example.

@Paola351 Go for it!!! Feel free to make it as simple/complex as you want, I love to see what people come up with. If you're familiar with Jupyter Notebook and want to do a detailed writeup that would be welcomed but is not mandatory.

Ok! I will code a simple Jupyter notebook able to load the library, load a profile, retrieve the post with maximum number of likes of that profiles, it is ok for you? @chris-greening

@beckettnormington Your example actually gave me an idea for a to_csv method so now you can write straight to .csv without the overhead of creating a pandas.DataFrame prior. If you want though feel free to continue with your implementation of the DataFrame, I like the emphasis of integrating pandas when working with instascrape because of obv data science connotations

Ok! I will code a simple Jupyter notebook able to load the library, load a profile, retrieve the post with maximum number of likes of that profiles, it is ok for you? @chris-greening

@Paola351 That would be an awesome example! You'll likely have to implement some sort of dynamic functionality if there are more than like 10 posts on a profile to get all the posts because of AJAX. If you check out profile_scrape.py there's a subclass of Profile that uses selenium that does exactly that. Feel free to reuse that code or come up with your own implementation!!

Alrighty, I'll make 2 versions! I'm currently adding detailed explanations to each snippet / line.

First CSV example converted to IPython. Now gonna work on a fun Matplotlib example comparing the Big Tech companies' posts and likes to see which one has the best reception overall.

Selenium didn't detect ChromeDriver, so that dampened my plans. ๐Ÿ˜ž

Selenium didn't detect ChromeDriver, so that dampened my plans. ๐Ÿ˜ž

@beckettnormington You'll have to download a chromedriver compatible with your version of chrome/OS. See this link for details

I used the latest stable release for Windows 10 and added it to PATH, but it still wasn't detected.

I used the latest stable release for Windows 10 and added it to PATH, but it still wasn't detected.

@beckettnormington I've had the same problem in the past, try passing the path to your driver with selenium.webdriver.Chrome(executable_path=r'C:\path\to\your\chromedriver.exe')

Alright, will try! I converted my Instagram CSV example to IPython. PR: #20

Ok! I will code a simple Jupyter notebook able to load the library, load a profile, retrieve the post with maximum number of likes of that profiles, it is ok for you? @chris-greening

@Paola351 That would be an awesome example! You'll likely have to implement some sort of dynamic functionality if there are more than like 10 posts on a profile to get all the posts because of AJAX. If you check out profile_scrape.py there's a subclass of Profile that uses selenium that does exactly that. Feel free to reuse that code or come up with your own implementation!!

I've checked that but it seems not working. Once i open the apple page on instagram, neither images are loaded or posts' info retrieved. I think It's a little bit trickier than i though :S

P.S..
nevermind, i figured it out