text in output as a message

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows 10 Store
Homepage
felixschon
Posts: 2
Joined: 15. Sep 2021, 18:29

text in output as a message

Postby felixschon » 15. Sep 2021, 18:38

Dear Pushsafer,

I'm pretty new in coding and on your platform.
I have created a web scraper in Python, which prints me a specific text that is taken out of the website. I would like to set a notification that says the scraped text in the message (the text is different each time I run the process).

I managed to set up message notifications using your example:
From pushsafer import init, Client

init("<privatekey>")
Client("").send_message("Message", "Hello", "323", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "2", "60", "600", "1", "", "", "")

Example of my scrape:
for Word6 in soup.findAll(attrs={'example' : 'heyhowyoudoin'}):
print(Word6.text.strip())

However I can't figure out how to set the printed scraped text in the message automatically each time.

Thank you very much for your support.
Felix

User avatar
admin
Site Admin
Posts: 749
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: text in output as a message

Postby admin » 16. Sep 2021, 07:22

that should do the job

Code: Select all

init("<privatekey>")
Client("").send_message(Word6.text.strip(), "Hello", "323", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "2", "60", "600", "1", "", "", "")
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

felixschon
Posts: 2
Joined: 15. Sep 2021, 18:29

Re: text in output as a message

Postby felixschon » 16. Sep 2021, 19:22

admin wrote:
16. Sep 2021, 07:22
that should do the job

Code: Select all

init("<privatekey>")
Client("").send_message(Word6.text.strip(), "Hello", "323", "1", "4", "2", "https://www.pushsafer.com", "Open Pushsafer", "0", "2", "60", "600", "1", "", "", "")
Thank you very much sir!
Should have thought of that before asking.
Now it sends me the notification, however the notification only includes the very last line scraped.
Lets say that Word6.text.strip() scrapes this from a website:

Apple is red
Orange is orange
Watermelon is green

The notification only includes 'Watermelon is green' even though it is all part of the Word6.text.strip() that is supposed to be notified.
Thank you very much for your time and sorry for beginner mistakes
Felix

User avatar
admin
Site Admin
Posts: 749
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: text in output as a message

Postby admin » 17. Sep 2021, 09:20

Hi, iam not a python pro

but try to change

Code: Select all

Word6.text.strip()
to

Code: Select all

Word6.text
strip() trim the text!
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 2 guests