GithubHelp home page GithubHelp logo

maximpiessen / instagram_network_analysis Goto Github PK

View Code? Open in Web Editor NEW
73.0 1.0 43.0 429 KB

Python 94.13% HTML 5.87%
network-analysis instagram-bot instagram-scraper instagram-analytics networkx community-detection graph-visualization graph-clustering graph-clustering-algorithm louvain-algorithm

instagram_network_analysis's People

Contributors

maximpiessen avatar nikhilsrajan avatar pharaohs-son avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

instagram_network_analysis's Issues

IndexError: list index out of range

The code
next = True
while(next):
n_li_1 = len(self.driver.find_elements_by_class_name("FPmhX"))
self.driver.execute_script(next_scroll)
time.sleep(1.5)
n_li_2 = len(self.driver.find_elements_by_class_name("FPmhX"))
if(n_li_1 != n_li_2):
following = self.driver.find_elements_by_xpath("//*[contains(text(), 'Following')]")
for follow in following:
el = follow.find_element_by_xpath('../..')
el = el.find_element_by_tag_name('a')
profile = el.get_attribute('href')
my_followers_set.add(profile)
else:
next = False

        return list(my_followers_set)

The error
Traceback (most recent call last):
File "get_my_followers.py", line 34, in
get_my_followers(config)
File "get_my_followers.py", line 20, in get_my_followers
my_followers = b.get_my_followers(username)
File "C:\Users\user\PycharmProjects\testing\bot.py", line 71, in get_my_followers
followers[1].click()
IndexError: list index out of range

no idea what to do

Clustering

how to plotting the result of clustering?

When try run get_my_followers.py got error

Traceback (most recent call last):
  File "get_my_followers.py", line 34, in <module>
    get_my_followers(config)
  File "get_my_followers.py", line 18, in get_my_followers
    b.login(username, password)
  File "/home/musicwarez/work/insta_download/visual/instagram_network_analysis/01 scraping/bot.py", line 42, in login
    self.driver.find_element_by_xpath("//button[contains(.,'Log In')]").click()
  File "/home/musicwarez/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/home/musicwarez/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
    'value': value})['value']
  File "/home/musicwarez/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/musicwarez/.local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[contains(.,'Log In')]"}
  (Session info: headless chrome=80.0.3987.122)
  (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-48-generic x86_64)

my_followers_txt not working

After running the get_my_followers.py script, nothing appears to be writted on my_followers.txt
Does anyone have the same issue?

relation_to_json.py error

Hi, I have an error message when I run "relation_to_json.py":

"Traceback (most recent call last):
File "relations_to_json.py", line 87, in
relations_to_json(config)
File "relations_to_json.py", line 24, in relations_to_json
with open(input_txt_file, 'r') as f:
OSError: [Errno 22] Invalid argument: 'relations.txt\'"

I didn't have this problem before but now I don't know what to do, maybe someone can convert my txt for me?

KeyError

Hey Maxim!

First thank you for that great documentation!
I tried to run your bot and everything went just fine so far but whenever I try to run you from_relations_to_json.py I get this:

Traceback (most recent call last):
File "relations_to_json.py", line 83, in
relations_to_json(config)
File "relations_to_json.py", line 55, in relations_to_json
id_2 = name_to_id[accounts[1]]
KeyError: 'zackbumm_'

Account 2 is pretty much the followed account in the very first line, as if:
https://www.instagram.com/sina_tabea/ https://www.instagram.com/zackbumm_/

It's not about that particular account name, I tried to delete a row and I always get the same result.
I'm working on a mac and maybe it's something about the .txt formation?

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.