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

A little help running the initial script for scraping: scrape_user.py #3

Closed
anoduck opened this issue Jul 8, 2020 · 6 comments
Closed

Comments

@anoduck
Copy link

anoduck commented Jul 8, 2020

Barely a novice programming python, and I am a little lost on how exactly the script is intended to be run. I opened up pycharm and attempted to add the variable then execute the script with the python console:

usr = User(some_user)
scrape_user(usr)

As you probably surmised this did not work in the least. Then I added the variable user = "some_user", then attempted to execute the script and this did not work as well. Adding user = User("some_user") failed as well. So, I am lost as to how exactly this is supposed to be run. A little help would be greatly appreciated.

@umitkaanusta
Copy link
Owner

Assuming that the error is about doing the scraping properly, the problem here is probably about the Twint package (and/or Twitter's own "alarms"). If so, you can execute the functions in scrape_user step by step. If a step does not work, wait 1-2 mins and re-run that step again until the desired output comes.

Can you post the error message if it's something else than what I said above

@anoduck
Copy link
Author

anoduck commented Jul 9, 2020

After running python3 scrape_user.py I recieve:

Traceback (most recent call last):
  File "scrape_user.py", line 1, in <module>
    from tia.stalk import URL_ROOT
ModuleNotFoundError: No module named 'tia.stalk'

@umitkaanusta
Copy link
Owner

You need to download TIA with the instructions given in README, seems like you're trying to use the script without downloading TIA.

@anoduck
Copy link
Author

anoduck commented Jul 9, 2020

No. I cloned the repository and use it as CWD. The README barely elaborates on how to run the script, which is why I opened the issue.
Let me walk you through my process.

  1. Clone the repository
    git clone https://github.com/umitkaanusta/TIA

  2. Change directory into repository
    cd TIA

  3. Install required packages from pip
    pip install -r requirements.txt

  4. At this point I should be ready to run the script.

  5. Change directory into tia/stalk
    cd tia/stalk

  6. Open up scrape_user.py in text editor.
    micro scrape_user.py

  7. Instructions in the bottom of the file are as follows:

        \# Create a user instance with the username, like uka = User("umitkaanusta")
        \# Then scrape_user(uka)
    
    
  8. (This is where the confusion begins.) I Add the following to the top of the file below the import statements.
    user = User("some_username")
    scrape_user(user)

  9. Save and close out editor.

  10. Execute the scrape_user.py script.
    python3 scrape_user.py

  11. I receive the following error:

Traceback (most recent call last): File "scrape_user.py", line 1, in from tia.stalk import URL_ROOT ModuleNotFoundError: No module named 'tia.stalk'

conclusion

What am I doing wrong? Why is this not working?

@umitkaanusta
Copy link
Owner

Main issue: #4

@anoduck
Copy link
Author

anoduck commented Jul 14, 2020

Thanks again!

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

No branches or pull requests

2 participants