InnerText, InnerHTML

Source: Internet
Author: User
Tags xpath

Innertest
Modify the text content of the label, if the modified string has a label format, will not show the label to the page

InnerHtml
Prints all the child tags in a label as a string, and if the modified string is formatted as a label, it is displayed directly on the page

Select operation
By value
Must be the value in option

SelectedIndex modified by the angle mark
Expand the Select tab and position 0-n from top to bottom

Css
1, the label
2, the head tag link
3. Style in head
. c1{
height:1px;
WID;; Xxxx
}
. c2{}

Common class
<div class= ' C1 C2 ' ></div>
Id
<div id= ' I1 ' ></div>

ClassName
Get Label class Property string type modified by space interval CSS Selector

Create a label
After child tags
div.insertadjacenthtml (' BeforeEnd ', str)
Child label Front
div.insertadjacenthtml (' Afterbegin ', str)
Get label Front
div.insertadjacenthtml (' Beforebegin ', str)
Get tag behind
div.insertadjacenthtml (' afterend ', str)

Delete
1, InnerHTML
2. Eleobj.removechild (Child) parameter accepts sub-label object

Refresh
Location.href = Location.href
Location.reload ()



= = and = = = Difference
= = Checks only if the value is the same and does not verify the data type

= = = Verify both data type and checksum value


Cycle
This loop supports arrays and dictionaries
var list = [' Dsx ', ' nn '];
var dict = {"Name": "Dsx", "Age": "18"};
for (var i in dict) {
Console.log (i)
}

This is a loop that does not support dictionaries
for (Var i=0;i<3;i++) {
Console.log (List[i])
}

Homework:
Improve the JS of the lottery page
Registered
Login
Lottery
View the winning record
View All prize information

Xpath
* Represents get all elements
@ followed by property name
*[@id = ' i1 ')
Attribute positioning
As long as the attribute in the tag can be positioned by @
Positioning by any unique attribute in a label
*[@placeholder = ' Please locate element by ID ']

Scope reduction through tagname
input[@placeholder = ' Please locate element by ID ']

Simultaneous multi-attribute positioning
input[@class = ' classname ' and @placeholder = ' locate element through classname ']


If you have to use a corner label for positioning via CSS selector You can choose to use XPath because CSS selector does not support corner positioning


1, Firefox browser Firebug firepath
2, Python installation Selenium
3, download Firefox, Google, ie drive and adjust
From selenium import Webdriver
Driver = Webdriver. Chrome ()
Driver.get (' http://ui.imdsx.cn ')

InnerText, InnerHTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.