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

getting profile pic #57

Open
boboliiii opened this issue May 22, 2024 · 3 comments
Open

getting profile pic #57

boboliiii opened this issue May 22, 2024 · 3 comments

Comments

@boboliiii
Copy link

hi there, thanks again for your amazing program!

i was wondering if there's a way to get the (url of) the profile pic? when i try and use get_profile i get nothing but the user's name (example below).

{'Friend_count': None, 'Follower_count': None, 'Following_count': None, 'Name': 'Mark Zuckerberg'}

i was wondering if there's any way to get the profile pic (and the about info)?

thanks in advance

@moda20
Copy link
Owner

moda20 commented Jun 14, 2024

@boboliiii just updated the repo, get_page_info will get you the necessary information including the profile and cover pictures

@boboliiii
Copy link
Author

thanks so much for doing this! i managed to do it myself in parallel, i'm quite a sloppy programmer though so i will not share my way unless you want me to.

little things that might be helpful to other people:

for me requests.get was crashing about 1 in 100 times, because somehow the url would be changed to intent://profile..blahblah..fallback_url.. .. not sure why it was doing this but changing the https to http magically stopped this behaviour.

to get full sized pics, i added "cookie": "locale=en_US;noscript=1", to the headers.json (and also chose a phone with a good screen like the latest Samsung). it's important to scrape the one named og:image and not the img src (for example, my code is:
linktoit = response2.html.html.split("og:image" content="")[1].split(""")[0].replace("&","&")

unsure if any of this is news to you but maybe it'll help any other fellow travellers that are plodding through the same issues

thanks again for you code, i've learned a lot from it

@boboliiii
Copy link
Author

the replace above should be replace & amp ; to &, (without spaces) github erased that last bit

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