usom.gov.tr Siber saldırı kaynaklarını yayınlamakta, bu siteler güvenlik cihazlarına tanımlandığında erişim engellene bilmektedir.
Paylaşmak istedim. XML veri okuma örneğidir.
Sub WebXMLOku()
' Tools > References, kısmından "Microsoft XML, v6.0" versiyonu seçiniz.
Dim xmlDoc As MSXML2.DOMDocument
Dim xEmpDetails As MSXML2.IXMLDOMNode
Dim xParent As MSXML2.IXMLDOMNode
Dim xChild As MSXML2.IXMLDOMNode
Dim Col, Row As Integer
Set xmlDoc = New MSXML2.DOMDocument
xmlDoc.async = False
xmlDoc.validateOnParse = False
' use XML string to create a DOM, on error show error message
If Not xmlDoc.Load("https://www.usom.gov.tr/url-list.xml") Then
Err.Raise xmlDoc.parseError.ErrorCode, , xmlDoc.parseError.reason
End If
Set xEmpDetails = xmlDoc.DocumentElement
Set xParent = xEmpDetails.FirstChild
Row = 2
Col = 2
Dim xmlNodeList As IXMLDOMNodeList
' xml icinde aranan kelime
Set xmlNodeList = xmlDoc.SelectNodes("//url-info")
Set sh = Worksheets("Zararli-Siteler")
sh.Range("A1:Z1000").Clear
For Each xParent In xmlNodeList
For Each xChild In xParent.ChildNodes
Worksheets("Zararli-Siteler").Cells(Row, Col).Value = xChild.Text
Debug.Print Row & " - "; Col & " - " & xChild.Text
Col = Col + 1
Next xChild
Row = Row + 1
Col = 2
Next xParent
End Sub
Paylaşmak istedim. XML veri okuma örneğidir.
Sub WebXMLOku()
' Tools > References, kısmından "Microsoft XML, v6.0" versiyonu seçiniz.
Dim xmlDoc As MSXML2.DOMDocument
Dim xEmpDetails As MSXML2.IXMLDOMNode
Dim xParent As MSXML2.IXMLDOMNode
Dim xChild As MSXML2.IXMLDOMNode
Dim Col, Row As Integer
Set xmlDoc = New MSXML2.DOMDocument
xmlDoc.async = False
xmlDoc.validateOnParse = False
' use XML string to create a DOM, on error show error message
If Not xmlDoc.Load("https://www.usom.gov.tr/url-list.xml") Then
Err.Raise xmlDoc.parseError.ErrorCode, , xmlDoc.parseError.reason
End If
Set xEmpDetails = xmlDoc.DocumentElement
Set xParent = xEmpDetails.FirstChild
Row = 2
Col = 2
Dim xmlNodeList As IXMLDOMNodeList
' xml icinde aranan kelime
Set xmlNodeList = xmlDoc.SelectNodes("//url-info")
Set sh = Worksheets("Zararli-Siteler")
sh.Range("A1:Z1000").Clear
For Each xParent In xmlNodeList
For Each xChild In xParent.ChildNodes
Worksheets("Zararli-Siteler").Cells(Row, Col).Value = xChild.Text
Debug.Print Row & " - "; Col & " - " & xChild.Text
Col = Col + 1
Next xChild
Row = Row + 1
Col = 2
Next xParent
End Sub
