internet explorer - How to I get news titles via PowerShell? -



internet explorer - How to I get news titles via PowerShell? -

i writing script in powershell should take 1 website , write them txt file. have it's creating new txt file , opening net explorer.

my code:

# create txt file containing 1 title per line if (test-path "$env:userprofile/titles.txt") { remove-item "$env:userprofile/titles.txt" } new-item -name "titles.txt" -path "$env:userprofile" -type file # create net explorer com object $url = "geekweek.pl" $ie = new-object -com internetexplorer.application $ie.visible = $true $ie.navigate($url) $doc = $ie.document # download title , save txt file #$elm = $doc.getelementsbyid("today-article") #$ta = ($url.allelements | ? { $_.class -eq 'tip' } | select innertext) #$ta = get-content ($url.links|where href -match '/#aktualnosci/') #write-host $ta

i seek id, class , element part of href (this seek allowed in comments). tell me doing wrong , can final script?

edit

$url = "geekweek.pl" $ie = new-object -com internetexplorer.application $ie.visible = $true $ie.navigate($url) $doc = $ie.document $today = $doc.getelementsbyname("today-article") | select-object -expandproperty outertext

the output receive

temat dnia miniaturowy akcelerator cząstek

internet-explorer powershell

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -