2013-01-31 52 views

回答

24

可以檢查一個屬性使用^=一定值開始:

find("img[src^='https://www.example.com/image']") 

的製品,The Skinny on CSS Attribute Selectors,描述了各種檢查(等於,開頭,結尾,等等):

#Equals 
find("img[src='https://www.example.com/image']") 

#Contains somewhere 
find("img[src*='https://www.example.com/image']") 

#Begins with 
find("img[src^='https://www.example.com/image']") 

#Ends with 
find("img[src$='https://www.example.com/image']")