Force closure of the popup on telegram “Open this link?” - python

When i use html formatting in a post and i create a link, Telegram show a popup before open the link. There is a script or something that force closure of the popup and open the link immediatly?
I don't want insert the link without HTML.

I press the enter key down(which I duplicated/remapped to the CapsLock key with Autohotkey) before I click a link. It worked easy & fortunate that there are no weird things will be triggered in the whole process.

There are no ways to close this popup. Telegram shows this for security reasons.

If you send the full URL, Telegram won't show this message.

Related

Is there any way to close popup while running headless chromium?

I am using the Playwright library to get data from a website. The issue is that website shows a popup when it open which results in stuck processes since the program is not able to get any button due to the popup.
Is there any way to close a popup each time it appears using the playwright?
Edit:
Page is creating a pop-up. I inspect the page and learnt that they are not using the modal for the pop instead they wrote the inline css and decorated a div as the popup.
Closing actual popups
I think browser.once("targetcreated", ...) as described in this issue https://stackoverflow.com/a/57246544/2202112 could be something that you are looking for.
It allows you to setup a callback on newly created targets.
For reference, see puppeteer docs on "targetcreated"
Closing modals
Find the selector for the button that dismisses the modal, for example .button-close or .button-dismiss.
Use the page.click(selector, [options]) method to click the button before continuing further scraping
As the documentation says Playwright will automatically dismiss all modal dialogs if there are no listeners of "dialog" event. Default behavior is essentially equivalent to
page.on('dialog', dialog => dialog.dismiss());
if it doesn't close in your case, it's most likely not a modal dialog (or a bug in playwright).
If the page opens another popup page, you can follow this guide but from your description it sounds more like a modal dialog.

How can I click "invisible" reCAPTCHA buttons using Selenium web automation?

I am using Python and Selenium to automate this website: https://prenotami.esteri.it
The script I made fills out a form and then clicks a button to advance to the next page. These actions are carried out using Selenium's find_element_by_xpath() function. Recently, the website added a reCAPTCHA that pops up after the button is clicked, and must be completed before advancing.
I have already written a Python script that is capable of surpassing this type of captchas by using the audio option. However, in this particular website, I am not able to find the xpath to the audio button of the reCAPTCHA. Although there is an iframe that contains the reCAPTCHA, there seems not to be anything inside it.
In the first attached image you can see how this website's reCAPTCHA looks like in HTML, compared to other website that is visible in the second image, where a #document can be seen inside the iframe.
My intention is to run this program using headless Chrome, so I can't relay in any mouse control functions offered by pyautogui for example.
I've been scratching my head around this problem for a while, so any advice is useful. Thanks!
Edit: after some research I have found that this type of reCAPTCHA that doesn't need to check a "I am not a robot" checkbox is called "invisible reCAPTCHA". The captcha only pops up if the detected activity is suspicious (for example clicking too fast). I have tried adding random waits and movements to mimic human behaviour, but the captcha still appears after some tries. Since I don't think there is a way to avoid the captcha from appearing 100% of the times, the question of how to click the buttons using Selenium's find_element_by_xpath() function remains the same. Leaving this as a note just in case someone finds it useful.
Ever tried to use the following function:
add_argument("-auto-open-devtools-for-tabs")
I managed to interact with captcha
If the position is always fixed, you can use PyAutoGUI to move the mouse and click on it
import pyautogui
pyautogui.click(100, 100) # button coordinates
Since, it is in iframe, we need to move our selenium pointing to iframe and then use your xpath.
driver.switch_to.frame("c-la7g7xqfbit4")
capchaBtn = driver.find_element_by_xpath("(//button[#id='recaptcha-audio-button'])[2]")

Is it possible to pick a specific button, that is on a page multiple times with selenium?

I am trying to code a program for somebody, that is possible to send and delete messages at the same time in the browser Discord application.(I think he wants to use this to spam?) He told me to write the code in Python, so I used python with Selenium. At this point I got everything working so far, the login works, the channel select works if you just insert the channel link directly. It also managed to let it send some messages. But problem now is, that I don't know how to delete the message after it was send, beacuse you need to click a "More" button first. But this more Button
I would use Webbot for that:
from webbot import Browser
web = Browser()
web.click('More')
that module has quite a few useful simple functions so i encourage you to try it

Selenium package for automating browser interactions

I am using selenium to automate repetitive task. It works really well. But I ran into a issue where I get an email sent to me which has a download button in it. I am not sure how to click on it? I can get the xpath but that only works once. Any help would be great!
Here is the button I am trying to select
Email's button
download_button = driver.find_element_by_xpath('//*[#id="m_-2340741114430056650background-table"]/tbody/tr/td/table/tbody/tr[4]/td/table/tbody/tr/td[2]/table/tbody')
The xpath only works once after I grab that specific path. The idea is that this email is sent every week and for me to automatically select the button for the download. There isn't other identifiers like name or id, etc for this element. The email is sent from another company, so I don't think I have access to changing the way it is sent.
Please let me know if you need more information. Thank you for any help.

Pressing a submit button in python using requests

So i want to check if my grades has been uploded, to do that i need to log in a website and then check if it has been changed.
the thing is after you log in you have two buttons: "agree" and "dont agree"
and when i try to press it, the website gives me an error message "wrong use
If you use a Personal Firewall, please deactivate it"
I'll upload my code in few hours
The website's code
Any help would be grateful.
You can use python-selenium to press buttons, you can also hide the browser instance.
Like #e4c5 said, you can really push button by python. As for me, the DevTools of Chrome does help a lot.
Here's the manual of the DevTools.
The 'Network' tab in DevTools will tell you all the requests and resources in the web page.If you want to see the detail request of the button-pushing action, You can firstly push the button and then see the new request shown in 'Network' tab.
You have to put Referer in the headers. This is how to bypass the university's check. Look at the original request (via Chrome dev tools), and copy the referrer into your request.

Categories