Jump to content

Search the Community

Showing results for tags 'implent'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hey, first off, thanks to everyone on this forum who has helped me out yet. I wouldnt have made it this far in such a short time, as I am a beginner. Now this is my last problem: (Well it's not rlly a problem as I could run both seperately, but I would like to create one script. Here is the first script: #NoTrayIcon #include <Inet.au3> #include <Array.au3> #include <String.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Global $url = InputBox("ScoutID","Please enter the Scout-ID (URL)") If StringInStr($url,"http://www.immobilienscout24.de/") = false Then MsgBox(48,"Error","URL not specified. Please make sure you enter the URL !") Exit Else EndIf Global $content = _INetGetSource($url) Global $string_A = _StringBetween($content, '<li data-item="result" data-obid=', 'id="result') $number =UBound ( $string_A ,$UBOUND_ROWS) $timesran = -1 $i=0 $numberarray = $number $numberarray -= 1 Do $i += 1 $timesran += 1 If $timesran = $numberarray = True Then Exit Else EndIf $id= StringReplace($string_A[$timesran],'"',"") $urlscout = "http://www.immobilienscout24.de/expose/"&$id export () Until $i = $numberarray func export () $url = $urlscout If StringInStr($url,"http://www.immobilienscout24.de/expose") = false Then MsgBox(48,"Error","URL not specified. Please make sure you enter the URL !") Exit Else EndIf If FileExists("Immobilien.csv") =false Then FileWrite("Immobilien.csv","Name;Adresse;Telefon;Objekttyp;Ort;Baujahr;Zimmer;Bezugfrei ab;Wfl./ qm;Kaltmiete;Warmmiete;Scout- ID"& @CRLF) EndIf $content = _INetGetSource($url) $name_A = _StringBetween($content, '<span data-qa="contactName" class="font-bold">', '</span>') $preis_A = _StringBetween($content, '<span class="is24-operator">', '<div class="sourcecode section">') $strase_A = _StringBetween($content, '<strong class="font-standard">' , '</strong><br/>') $telefon_A = _StringBetween($content, '<div class="is24-phone-number hide">' ,'</div>') $objekttyp_A = _StringBetween($content, '<dd class="is24qa-wohnungstyp">' ,'</dd>') $ort_A = _StringBetween($content, '<span id="quickCheckHeader" class="is24-f">' , '</span>') $baujahr_A = _StringBetween($content, '<dd class="is24qa-baujahr">','</dd>') $zimmer_A = _StringBetween($content, '<dd class="is24qa-zimmer">','</dd>') $bezugsfrei_A = _StringBetween($content, '<dd class="is24qa-bezugsfrei-ab">' ,'</dd>') $wohnflache_A = _StringBetween($content, '<dd class="is24qa-wohnflaeche-ca">' ,'</dd>') $preiswarm_A =_StringBetween($content, '<strong class="is24qa-gesamtmiete">','</strong>') If IsArray($strase_A) Then $strase_B = $strase_A[0] Else $strase_B = "/" EndIf If IsArray($name_A) Then $name_B = $name_A[0] Else $name_B = "/" EndIf If IsArray($telefon_A) Then $telefon_B = $telefon_A[0] Else $telefon_B = "/" EndIf If IsArray($objekttyp_A) Then $objekttyp_B = $objekttyp_A[0] Else $objekttyp_B = "/" EndIf If IsArray($baujahr_A) Then $baujahr_B = $baujahr_A[0] Else $baujahr_B = "/" EndIf If IsArray($preiswarm_A) Then $preiswarm_B = $preiswarm_A[0] $preiswarm_C = StringReplace($preiswarm_B , "disabled","") $preiswarm_D = StringReplace($preiswarm_C, "disabled","",1) ;caused some bugs $preiswarm_E = StringReplace($preiswarm_D, "disabled","") Else $preiswarm_B = "/" EndIf If IsArray($zimmer_A) Then $zimmer_B = $zimmer_A[0] $zimmer_C = StringReplace($zimmer_B , ".",",") Else $zimmer_B = "/" EndIf If IsArray($ort_A) Then $ort_B = $ort_A[0] Else $ort_B = "/" EndIf If IsArray($bezugsfrei_A) Then $bezugsfrei_B = $bezugsfrei_A[0] Else $bezugsfrei_B = "/" EndIf If IsArray($wohnflache_A) Then $wohnflache_B = $wohnflache_A[0] Else $wohnflache_B = "/" EndIf If IsArray($preis_A) Then $preis_B = $preis_A[0] Else $preis_B = "/" EndIf $aio= $name_B&";"&$strase_B&";"&$telefon_B&";"&$objekttyp_B&";"&$ort_B&";"&$baujahr_B&";"&$zimmer_C&";"&$bezugsfrei_B&";"&$wohnflache_B&";"&$preis_B&";"&$preiswarm_E&";"&$url $sString1 = StringReplace($aio, " ", "") $sString2 = StringReplace($sString1, "<p>", "") $sString3 = StringReplace($sString2, "<span>", "") $sString4 = StringReplace($sString3, "</p>", "") $sString5 = StringReplace($sString4, "Â", "") $sString6 = StringReplace($sString5, '<span class="is24-operator">=</span>', "") ;Filtering the given Data to get a proper CSV Format $sString7 = StringReplace($sString6, "EUR", "") $sString8 = StringReplace($sString7, "</span>","") $sString9 = StringReplace($sString8, "Dieses Objekt im Vergleich zu anderen in ","") $sString10 = StringReplace($sString9, "disabled",",00") ;caused bug $sString11 = StringReplace($sString10, "ü","ü") $sString12 = StringReplace($sString11, "ß","ß") ;Including special characters lower case $sString13 = StringReplace($sString12, "ä","ä") $sString14 = StringReplace($sString13, "ö","ö") $sString15 = StringReplace($sString14, "Ãœ","Ü") ;Including special characters upper case $sString16 = StringReplace($sString15, "Ä","Ä") $sString17 = StringReplace($sString16, "Ö","Ö") $sStringfinal = StringReplace($sString17, @CRLF, "") FileWrite ( "Immobilien.csv", $sStringfinal & @CRLF ) ToolTip("Importing...", 0, 0) Sleep(100) endfunc This script works perfectly fine to extract ALL the data from one page which looks like this : http://www.immobilienscout24.de/Suche/S-T/Wohnung-Miete/Bayern/Muenchen/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/true?enteredFrom=result_list (The export function downloads all data from each object on the side into a cvs file.) BUT this is just one of 19 pages, so I made this script which counts the pages and then in a loop sets $currenturl always +1 until $currenturl and the total pages (19) match and then exits. #NoTrayIcon #include <Inet.au3> #include <Array.au3> #include <String.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Global $url = InputBox("ScoutID","Please enter the Scout-ID (URL)") If StringInStr($url,"http://www.immobilienscout24.de/") = false Then MsgBox(48,"Error","URL not specified. Please make sure you enter the URL !") Exit Else EndIf Global $content1 = _INetGetSource($url) Global $pagecount = _StringBetween($content1, '<li><span>&hellip;</span></li>', '<span class="smallPager">') $filtered = StringRegExp($pagecount[0],"\d{2}",$STR_REGEXPARRAYMATCH) $link0 = StringReplace($url,"http://www.immobilienscout24.de/Suche/S-T/","") $link1 = StringReplace($url,$link0,"") $link2 = "/" & $link0 $pages = $filtered[0] ; 19 in the example $currentpage = 0 Do $currentpage +=1 $currenturl = $link1 & "p-" & $currentpage & $link2 MsgBox(0,"",$currenturl) Until $pages = $currentpage Now my question is, if there is anyway to implent the second into the first script to work the following way: 1.) Basically run the second script to generate the first $currenturl 2.) Run the first script to grab all data from $currenturl 3.) The second script "prints" the second $currenturl 4.) The first script again grabs all data from $currenturl .... 5.) Until $currenturl = $filtered ($filtered = total amount of pages) I tried my best to explain it as good as possible, even tho its complicated to get what I mean... THANKS IN ADVANCE! & best regards, Andrewz
×
×
  • Create New...