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

Fixed profile ID #14

Merged
merged 2 commits into from
Mar 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import time
import zipfile
import re
from selenium import webdriver
from getpass import getpass

Expand Down Expand Up @@ -182,7 +183,18 @@ def init():
cont = True

print('Loading...\n')
profile = [x for x in driver.find_elements_by_tag_name('a') if x.get_attribute('title') == 'Profile'][0].get_attribute('href').split('/')[3]
profile_url = [x for x in driver.find_elements_by_tag_name('a') if x.get_attribute('title') == 'Profile'][0].get_attribute('href')
re_search = re.search(r'(\?id=\d+)$', profile_url)

profile = ''
if re_search:
# Profiles with no username
profile = re_search.group(0)
profile = profile.replace('?id=', '')
else:
# Profiles with username
profile = profile_url[profile_url.rfind('/')+1:]

driver.get('https://www.facebook.com/messages/'+profile)

global replyButton
Expand Down