Skip to content

Commit

Permalink
Merge pull request #37 from rpotter12/pull
Browse files Browse the repository at this point in the history
updating savechat.py
  • Loading branch information
rpotter12 authored Aug 12, 2019
2 parents 024b6a5 + 91c3c22 commit 2878dd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
3 changes: 1 addition & 2 deletions wplay/locationfinder.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import os


def locationfinder(name):

# to find location by ip address
print('Get you ipinfo token from https://ipinfo.io/account')
ip_address = '45.248.160.61'
ip_address = '*'
token = str(input("Enter your ipinfo token: "))
ip_string = 'curl ipinfo.io/'+ip_address+'?token='+token+''
os.system(ip_string)
20 changes: 10 additions & 10 deletions wplay/savechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeatifulSoup
import requests

def save(name):

Expand All @@ -23,14 +25,12 @@ def save(name):
person_title.click()

f=open('messages.txt','w')
f.close()
# to catch messages
while True:
try:
time=driver.find_element_by_class_name('copyable-text').text
messages=driver.find_element_by_class_name('selectable-text invisible-space copyable-text ').text
f=open('status.txt','a')
f.write(time+" : "+messages)
f.close()
except (NoSuchElementException):
break;

page = requests.get("https://web.whatsapp.com/")
soup = BeatifulSoup(page.content, 'html-parser')

messages = soup.find_all('div', class_='_1_q7u')
string_messages = str(messages)
f.write(messages)
f.close()

0 comments on commit 2878dd6

Please sign in to comment.