viniciusalmeidas / Wpp-Sender

Wpp-sender: Send messages via WhatsAppWeb (on Chrome) to a phone book stored in Excel. Interface (PySimpleGUI), Code (Python 3.8.2)
MIT License
2 stars 0 forks source link

Excel format and Attachments #2

Open DevDorrejo opened 4 years ago

DevDorrejo commented 4 years ago

Hello, what is the format for the excel?, there isn't one on the repos, thank you.

viniciusalmeidas commented 4 years ago

thanks, i already put the excel file on the repositary, pls check that out ! on the first column you should put the name contact, and on the second column you have to put the phone number, for instance: I from Brazil so here we go: 55(BR) +(21)(RJ) + MyPhone

Name Phone
Vinicius 55 21 987422122
John 55 11 982736132
viniciusalmeidas commented 4 years ago

Thanks for your collaboration.

"Coming together is a beginning, staying together is progress, and working together is sucess." - H. Ford

Vinícius Almeida de Souza

DevDorrejo commented 4 years ago

thank you, is there a way to send emojis?, i am helping an educative community on my sector for child/parents and we want to send dynamic msg with this

when try send emoji and any sentence/paragraph that start with a symbol will fail.

thank you.

viniciusalmeidas commented 4 years ago

Ohhh, that's a very good question. In this bot I import a lib called docx import docx

This lib copy and paste each strings on the Word(docx) File. So it's such different than press Keys on your keyboard or ActionChains from selenium.webdriver.common.keys import Keys _element_blablabla.send_keys(' : ) ')_.

That's why we cannot send emoji and the pretty format of paragraph, but you can substitute that Lib and put some Text on your code or even inside a label on the PySimpleGUI user interface using for instance (.send_keys).

DevDorrejo commented 4 years ago

Ohhh, that's a very good question. In this bot I import a lib called docx import docx

This lib copy and paste each strings on the Word(docx) File. So it's such different than press Keys on your keyboard or ActionChains from selenium.webdriver.common.keys import Keys _element_blablabla.send_keys(' : ) ')_.

That's why we cannot send emoji and the pretty format of paragraph, but you can substitute that Lib and put some Text on your code or even inside a label on the PySimpleGUI user interface using for instance (.send_keys).

Thank you very much,

found a much simple way, change the driver from chrome to firefox.

and other thing, is possible to send image and video? or how can i integrate it?

viniciusalmeidas commented 4 years ago

Yeah, when choose Selenium better use Firefox. FirefoxDriver has bundled with selenium standard alone library. That makes it is easy to initialize and run some code.

I choose docx to make a better UX, the users just need do edit the Word file, but they can't send media or emoji inside that text. If you can help me if this i'll accepeted ur commits on master and will apreciate it. i don't have much time thou.

if u need to send images i don't advise u to use libraries like Twillio and the famous Yowsup - Twilio - YouTube. They're great python libraries! Simply awesome. Their problem is: They connect to Whatsapp servers directly, without any middlware. So it is not so hard for whatsapp team to create ban-rules you if you are using it.

I think this code works well if u need to attach images(PNG, JPEG, ...):

 image_path = "C:/Users/VINÍCIUS/Pictures/Banski.jpg"
 def send_image(driver, image_path):
    driver.find_element_by_css_selector("span[data-icon='clip']").click()
    driver.find_element_by_css_selector("input[type='file']").send_keys(image_path)
    sleep(3)
    driver.find_element_by_xpath("//*[@id='app']/div/div/div[2]/div[2]/span/div/span/div/div/div[2]/span/div/div").click()
    sleep(2)

image

DevDorrejo commented 4 years ago

thank you very much, i will try, i dont know python so is a little hard, i am starting to know this language because of this project, this app give a big help those with good intentions on the education zone.

viniciusalmeidas commented 4 years ago

don't worry u are doing very good, congrats !!! If u're using on education and classes propose you can create a DISCORD Server to comunnicate. In the other hand, this bot helps a lot on prospectattion new students to your classroom or school.