I've been fiddling for several hours to find a solution to scrapa data of about 1000 products in Google Spreadsheet.
Here's a sample of the source code:
<dl class="attributes">
<dt class="attr-title">Toepassing:</dt>
<dd class="attr-value">Reistas</dd>
<dt class="attr-title">Doel:</dt>
<dd class="attr-value">Reizen</dd>
<dt class="attr-title">Volume:</dt>
<dd class="attr-value">25 l</dd>
<dt class="attr-title">Materiaal:</dt>
<dd class="attr-value">Polyester</dd>
</dl>
I have a list of al the URL's of the products in column 1, and this in column 2: =query(ImportXML(A1;"//dl//dt[contains(text'Toepassing:')]/dd");"select* limit 1")
The result is #N/A (XML can't be parsed).
The reason I'm using the "contains text" is because the dl list is not consistent. Some do have extra, or less items. I've been using this =query(ImportXML(A2;"//dl/dd[2]");"select* limit 1")
which did give the data, but the data and columns went wrong.
更正您的xpath:
//dl//dt[contains(text(), "Toepassing:")]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.