VBA - How to select tab on webpage - html

I've seen a couple of questions similar to this but have had no success.
I am trying to write a piece of code after navigation to a secure webpage which will click on a tab and load this data (there is no URL behind the tab so cannot use that). I need to click on the sales tab which has the ID overview. Can someone please help me write a line of code which will find this object and click on it. HTML Code
Many thanks
fyi i tried stuff like
ie.document.getelementbyID("overview")(0).Click

You can select
ie.document.querySelector("div[id=overview]")
So if clickable try:
ie.document.querySelector("div[id=overview]").Click
Or simply
ie.document.querySelector("#overview").Click
That is assuming the element isn't inside a form/frame/iframe. Can't tell from the small HTML sample though.

Related

VS Code isn't recognizing html files

VS had suddenly stopped recognizing HTML files and it doesn't autocomplete tags or even show the syntax unless I manually input every single file name in it, I would really appreciate the help on any idea how to solve that Here is how it looks:
I have tried many things but nothing seems to work or help fix it
See if this solves the problem:
On the bottom right of the application, you should see something like this:
Click on the "Plain text".
Search HTML in the list and click it.
Then your HTML should turn colorful.

How to show completed html source on chrome?

I'm trying to take the full html source of the tab in
this page
I want to take the source of
this tab
But unfortunately, the html I'm getting is not completed.
I registered a gif to explain it better
That select list is showing just when I inspect the element, while If I just insect the element with the list closed, it doesn't return any list html.. is it created dinamically when the user click on it?
I've tried to expand all the codes, but unfortunately it seems the html of every list is not appearing.. It might be created just when I open the list?
Is there a way to get the lists html?
Hope I've been clear.
Not sure what you want to save, but by inspecting it sources, it seems that the website use the way of removing and appending the html source which means only you pressed the expanded button, Javascript will append it (different options) to the body, otherwise it will not shown in the element tab.
I don't think you could get all html tags in just 1 try because the website use Javascript to append the html and you can't see it in the element section in console when the element is being removed.
Example:
You can save the page if you want. Just save it with Ctrl+S and you will find the basic source in there along with the stylesheet and other scripts.

How to make a search box search google with HTML?

Lately, I've been working on a page in html which is supposed to search Google. I have a search box and a button but I'm wondering what the most efficient way to get the results from Google and display them on my page. If anyone knows I'd be glad if they helped me out.
{EDIT}
This is just a little project I'm working on. To be more specific I'd like to make it where what is typed in the search box gets taken from www.google.com/search and then the results of the Google search are displayed below.
Answer & Demo
You can create a custom google search engine for your sites, follow the steps, then get the code and paste it in a div inside the body tag. Here is a JSFiddle with an example of this (site:stackoverflow.com).
You can then edit the way the engine looks in the look and feel tab in the edit search menu.
Hope this helps, good luck! :)
So you're saying you want an HTML page with a single input and a submit button.
When the user enters text into the input and then presses submit what would you like to happen?
I see two basic approaches.
Pass the search string as a parameter in the URL so the next page can be made aware of it using javascript. then use xmlhttprequest to grab the data from google and do a document.write to render the information to the user:
example
Insert a Div with some id in the page and then use the submit's onclick attribute to initiate an AJAX call that gets the data from google and then inserts it into the div's innerHTML without the need for multiple pages.
[UPDATE}
after looking into this it seems that XMLHttpRequest will not work with google and that the API is the way to go.
source

How to open an iframe from clicking an image

I'm wondering if anyone can help me. I'm hoping I can open an iFrame in the centre of my webpage from clicking a picture. So in effect the iframe would be hidden until the picture is clicked. I have a very small and simple upload form on another page that I would like to appear when the user needs to upload and click the picture. I've had a good look round on this site and google in general but not found what I'm looking for, or the basics weren't included because it's common knowledge for most people here. Would there also be a way of closing this when it's finished uploading too? The form currently diverts to the homepage when finished so It would be handy to have a close option as in the end (post successful upload) the iframe contents will be the same as the page it's displayed on.
The best/easiest I have come across has been on w3schools but I have read using html for iFrames is not widely accepted or it isn't the best option cross-browser.
I have been viewing and trying different code but without even the basic knowledge I can't get my head around it.
If anyone is able to help, please assume I'm 5 years old. I'm not daft but in terms of code I'm literally just starting.
Thanks in advance
You would need to add a javascript onclick function to your img tag which would open a new window upon a click. You would pass the window.open function the name of the html file you want to display. Something like this:
<img src="image.jpg" onclick="window.open('welcome.html')">

Jsoup - Trying to extract Comments number from web page

I'm trying to extract the overall comments number from a web page using Jsoup.
For example, here is a page (CNN): http://edition.cnn.com/2011/POLITICS/07/31/debt.talks/index.html?hpt=T1
I see that the class ID is cnn_strycmtsndff, but can't get to find the right command to extract it.
Can someone help?
Thanks
Unfortunately, I don't think Jsoup is going to cut it. If you use the Chrome developer tools you can clearly pick out the HTML used for presenting the "(##### Comments)" section, but if you just view the source, none of that information is there. It seems like they are using some Javascript to dynamically embed the information in the page.
This is what you see in "View Source":
<div id="disqus_thread"></div><script type="text/javascript" src="http://cnn.disqus.com/embed.js"></script>
So Jsoup will never be able to see the elements with the comment information.