- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2416 Articles for HTML
622 Views
In this post, we will understand the difference between HTML and XML.HTMLIt refers to Hyper Text Markup Language.It helps create web pages and applications.It is a markup language.It helps create static pages as well.It helps display data.It doesn’t transport data.HyperText helps define link between multiple web pages.Markup Language helps define text document using tags, which gives a structure to the web page.It helps annotate the text so that a system can understand it and use it.It ignores minor errors.It is not case sensitive.There are specific number of tags in HTML.These tags are predefined.It doesn’t preserve white spaces.Closing tags are not ... Read More
363 Views
By specifying padding of an element in percentage, we can maintain its Aspect Ratio. The aspect ratio is the ratio of image’s width to its height. The aspect ratio can also be maintained using the aspect-ratio property. Aspect ratio for videos with the padding-top property Use the padding-top property to set the aspect ratio of an element on a web page. Here is the CSS padding property − The padding-bottom specifies the bottom padding of an element. The padding-top specifies the top padding of an element. The padding-left specifies the left padding of an element. The padding-right specifies the ... Read More
21K+ Views
Create a fixed header on scroll in HTML tables using the position property with the value sticky and top property 0. Set both these properties for the header i.e., the element. We will see two examples to set fixed headers on scroll, one using flex and another without using the flex concept. Create a fixed header on scroll using flex The following example give us an idea to create a fixed header on scroll with flex − Set the container for the table A container div is included and within that the table is set using the . ... Read More
1K+ Views
Problem:One of the most challenging taks for a data sceintist is to collect the data. While the fact is, there is plenty of data available in the web it is just extracting the data through automation.Introduction..I wanted to extract the basic operations data which is embedded in HTML tables from https://www.tutorialspoint.com/python/python_basic_operators.htm.Hmmm, The data is scattered in many HTML tables, if there is only one HTML table obviously I can use Copy & Paste to .csv file.However, if there are more than 5 tables in a single page then obviously it is pain. Isn't it ?How to do it..1. I will ... Read More
627 Views
We can simulate pressing enter in the html text input box with Selenium webdriver. We shall take the help of sendKeys method and pass Keys.ENTER as an argument to the method. Besides, we can pass Keys.RETURN as an argument to the method to perform the same task.Also, we have to import org.openqa.selenium.Keys package to the code for using the Keys class. Let us press ENTER/RETURN after entering some text inside the below input box.ExampleCode Implementation with Keys.ENTER.import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.By; import org.openqa.selenium.Keys; public class PressEnter{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", ... Read More
12K+ Views
We can get html source of a webelement with Selenium webdriver.We can get the innerHTML attribute to get the source of the web element.The innerHTML is an attribute of a webelement which is equal to the text that is present between the starting and ending tag. The get_attribute method is used for this and innerHTML is passed as an argument to the method.Syntaxs = element.get_attribute('innerHTML')We can obtain the html source of the webelement with the help of Javascript Executor. We shall utilize the execute_script method and pass arguments index.innerHTML and webelement whose html source is to be retrieved to the ... Read More
2K+ Views
We can set the style display of an html element with Selenium webdriver. The DOM interacts with the elements on the page with the help of Javascript. Selenium executes the Javascript commands by taking the help of the executeScript method. The commands to be executed are passed as arguments to the method.Some operations like setting the style display be performed by Javascript Executor. The getElementById method can be used to locate the element. Then we have to apply the style.display method on the webelement and set the display type.Syntaxexecutor.executeScript ("document.getElementById('gsc-i-id1').style.display='block';");ExampleCode Implementation.import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; ... Read More
4K+ Views
We can get the html code of a webelement with the help of Selenium webdriver. We can obtain the innerHTML attribute to get the HTML content of the web element.The innerHTML is an attribute of a webelement which is equal to the content that is present between the starting and ending tag. The getAttribute method is used for this and innerHTML is passed as an argument to the method.SyntaxString s = element.getAttribute('innerHTML');Let us see the below html code of an element. The innerHTML of the element shall be < You are browsing the best resource for Online Education.ExampleCode Implementationimport org.openqa.selenium.WebDriver; ... Read More
396 Views
We can work with iframe in Selenium webdriver. A frame is defined with , or tag in html code. A frame is used to embed an HTML document within another HTML document.Selenium by default has access to the parent browser driver. In order to access a frame element, the driver focus has to shift from the main browser window to the frame. There are more than one methods to shift to frames −switchTo().frame(id) - The id or name of frame is passed as an argument.Syntax − driver.switchTo().frame("id"), switching to the frame with id.switchTo().frame(m) - The index of frame ... Read More
3K+ Views
We can access HTML source code with Selenium webdriver. We can take the help of the page_source method and print the value obtained from it in the console.Syntaxsrc = driver.page_sourceWe can also access the HTML source code with the help of Javascript commands in Selenium. We shall take the help of execute_script method and pass the command return document.body.innerHTML as a parameter to the method.Syntaxh = driver.execute_script("return document.body.innerHTML;")ExampleCode Implementation.from selenium import webdriver driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") driver.implicitly_wait(0.5) driver.get("https://www.tutorialspoint.com/index.htm") # access HTML source code with page_source method s = driver.page_source print(s)Code Implementation with Javascript Executor.from selenium import webdriver driver = webdriver.Chrome(executable_path="C:\chromedriver.exe") driver.implicitly_wait(0.5) ... Read More