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

How to run scrape_user.py? #4

Closed
anoduck opened this issue Jul 9, 2020 · 2 comments
Closed

How to run scrape_user.py? #4

anoduck opened this issue Jul 9, 2020 · 2 comments

Comments

@anoduck
Copy link

anoduck commented Jul 9, 2020

@umitkaanusta 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?

Was this written in Windows by any chance?

Originally posted by @anoduck in #3 (comment)

@umitkaanusta
Copy link
Owner

Now I checked the error, yes TIA was written in Windows. Windows editors add some hidden characters at those init.py files, which makes them incompatible with Linux. Thank you for addressing this issue, I'll add a warning in README and work on this compatibility issue later on.

@anoduck
Copy link
Author

anoduck commented Jul 14, 2020

That makes sense now. I will try it out on a windows virtualized instance and see if I have better luck. It explains why the import statements had no effect. I don't have pycharm for Windows, but I will install VScode and try it there.

Thanks for the help resolving the confusion.

@anoduck anoduck closed this as completed Jul 14, 2020
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