string(36) "Document.links プロパティ (DOM)" Document.links プロパティ (DOM) | UWSC辞典

links

文書中の、href属性の値を持つすべての<area>要素とアンカー要素のコレクションを返します。

構文
nodeList = Document.links
引数
戻り値

プログラム実行例

内部リンクを取得

DIM IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.Visible = TRUE
IE.Navigate("http://example.com")
BusyWait(IE)

DIM links[-1]

FOR n = 0 TO IE.document.links.length - 1
	arrayPush(links, IE.document.links[n].href)
NEXT

arrayFilter(links, "POS(<#DBL>" + IE.document.domain + "<#DBL>, %val%)")

FOR item IN links
	PRINT item
NEXT

IE.Quit
  1. CREATEOLEOBJ
  2. IE.Visible
  3. IE.Navigate
  4. IE.document
  5. Document.links
  6. Document.links.length
  7. arrayPush
  8. Document.links.href
  9. arrayFilter
  10. Document.domain
  11. IE.Quit

外部リンクを取得

DIM IE = CREATEOLEOBJ("InternetExplorer.Application")
IE.Visible = TRUE
IE.Navigate("http://example.com")
BusyWait(IE)

DIM links[-1]

FOR n = 0 TO IE.document.links.length - 1
	arrayPush(links, IE.document.links[n].href)
NEXT

arrayFilter(links, "!POS(<#DBL>" + IE.document.domain + "<#DBL>, %val%)")

FOR item IN links
	PRINT item
NEXT

IE.Quit
  1. CREATEOLEOBJ
  2. IE.Visible
  3. IE.Navigate
  4. IE.document
  5. Document.links
  6. Document.links.length
  7. arrayPush
  8. Document.links.href
  9. arrayFilter
  10. Document.domain
  11. IE.Quit

Was this post helpful?