click html button no onclick/link - javascript

I am trying to automate a task with python. This task is simply to open a link, put some text into the field and click the button. I can't seem to figure out where the link is for this button/how to click this button through python or a different programming language. I dont see an onclick() or ref/link for it. When I get the html code for the site the button is not in it but when I inspect the elements of the page I can see it. Please let me know what I should do thanks in advance. webpage_elements

Related

Can a button be un-clickable with Javascript?

Please excuse me for asking such a specific question, but I am trying to help a parent automate the filling out of information on the a website which they must do daily for their child to go to school.
Here is the relevant HTML snippet from the above website
<div class="text-center" id="btnDailyScreeningSubmit">
<button type="button" class="btn btn-primary mt-2 btn-lg" onclick="showLayout('#guest_questions')">Fill Out Daily Screening</button>
</div>
I am trying to click on the button at the bottom of the page that says "Fill Out Daily Screening" using JS. The JS will be integrated into a Siri Shortcut, using the Scriptable App for iPhone, so I am able to import some JS libraries into the script if that would help this at all.
I have tried
document.getElementById("btnDailyScreeningSubmit").click();
document.getElementById("btnDailyScreeningSubmit").submit();
which does not work. Nothing happens on the webpage and the Chrome JS Console comes back with "undefined".
I have tried the generic
document.forms[0].submit();
Which I guess submits the form, but that is not what the site is looking for. Instead of going on to the next page, the browser returns a JSON response.
I was hoping there might be a way to click the button based on its location on the website, but I have not been able to find anything promising in that area.
So I am reaching out to all the JS experts on here to find out if there is a way to click that button on that website?
You need to click the button inside the div element instead.
document.getElementById("btnDailyScreeningSubmit").querySelector('button').click();
You cannot click things from javascript until the user has clicked on the page... add a mousedown listener to the window then try it.

Need help finding button id/class etc to click

I'm writing a Python script to enter MS Teams and join a class based on a schedule, and have very little to no knowledge of markup languages/ js.
This "Join" button is what i want to click.
When i click inspect on it, I get (Highlighted in blue):
My code to click the button:
driver.get(physics)
driver.find_element_by_xpath('//input[#class=""]').click()
need help finding the class/id/ anything to be honest, to click the button.
The rest of my code: code
You can find the details of the button from below the screenshot.
But it is not recommended to use the classes for the same as they might be repetitive on the entire page.
The button is highlighted in the inspector tools.
Note: class root-160 is a dynamic class and you might not wanna use it. It will change per meeting/pages.
Screenshot of button component

Run HTML inside a Text box

I would like to be able to run a html code with javascript inside a text box. Just like they do it at w3schools.com . I'm only using html and javascript no other languages. Thank you
Example: I have two text areas one where we insert html and click a button and run the html and it displays in the other text area.
I found some code that might make this happen but can not get it to work. I'm using chrome if that helps.
Here is the link to the basic code where i went to get this from.
http://forgottengamer.blogspot.com/2013/01/make-html-editor-like-w3schools-try-it.html
Here is a link to my code
https://docs.google.com/document/d/1pT2SVBaUkqeZo5n3ow76HDrG3OzO6zzohUFH6r6RCJY/edit?usp=sharing
To achieve this, you'll need to do the following
Create a textbox where user will enter its HTML content.
On submit, create a dynamic iframe with dynamically inserting the DOM from the HTML of the user entered above.
This should be fairly easy ignoring the security measures. Upto you!

submit button with no form filling

Hi i want a button to be shown on all my pages.
that code should be in such a way that no form filling is needed
the text on button will be "Problem? Click Here"
when click on button, it will be pressed and the person who has clicked cannot click again unless reload the page.
After the button is clicked the mail should be sent to admin with the exact link of page where button was clicked.
there should be no form to fill.
As for example facebook like button like the content meanwhile its pressed.
What should be the code for this? Any suggestion please?
Thank you
You can use an HTML button element with an onclick javascript function linked to it.
Since you don't want the button to work again until you have reloaded the page, you will need to do this through AJAX. This means you will have to send a request to the server, where, for instance, a PHP script will retrieve the page name from a GET variable and send the email to the administrator. The javascript part can keep track of the button being clicked once or not.
That should give you some pointers on where to start with your code. However, as stated in direct comments to your question, this site is not meant for asking for coding work to be done for you. Perhaps next time, try to think of a possible solution and ask for advice on your solution (improvements, coding conventions, etc)

Bookmarklet to select all friends and add them to an event on Facebook

I am trying to make a bookmarklet to allow me to select all my friends in the dialog to create an event on Facebook. Examining the source with Firebug shows the following:
The div container for each person gets a new class label of
selectedCheckable
when it it is clicked, So I have written this like of JS to try and select all the div's and give them this class:
$(".checkableListItem").addClass("selectedCheckable");
This works in selecting them, however when it comes time to press the "Save and close" button, the changes do not seem to have any effect in selecting all the friends to add to the event. It seems that FB has a different way of marking the friends that have been selected to add to the event. Would anyone be able to point me in the right direction so I can accomplish this? Thanks in advance, RayQuang :)
May I advise instead of making your own couldn't you just use one of these Greasmonkey scripts?
http://userscripts.org/scripts/search?q=facebook+invite&submit=
That's what I was doing and it was working for my events. Let me know if it works for you.

Categories