Advertisement
anonymous1184

https://redd.it/vwkvdg

Jul 11th, 2022
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ids := ["B000C1Z3J0", "B000OUTTP8"]
  2. ua := "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
  3. http := WinHttpRequest({"UA":ua})
  4. for _,articleId in ids {
  5.     html := http.GET("https://www.amazon.co.uk/dp/" articleId)
  6.     document := ComObjCreate("HTMLFile")
  7.     document.Write(html)
  8.     title := document.getElementById("productTitle").outerText
  9.     overview := document.getElementById("productOverview_feature_div").outerText
  10.     image := document.getElementById("landingImage").src
  11.     desc := ""
  12.     loop Parse, % overview, `n, % "`r "
  13.         desc .= A_LoopField (Mod(A_Index, 2) ? ": " : "`n")
  14.     UrlDownloadToFile % image, % A_Temp "\image"
  15.     Gui Test_:New, +LastFound
  16.     Gui Font, w800
  17.     Gui Add, Text,, Title:
  18.    Gui Font, w400
  19.     Gui Add, Edit,, % title
  20.     Gui Font, w800
  21.     Gui Add, Text,, Description:
  22.    Gui Font, w400
  23.     Gui Add, Edit,, % desc
  24.     Gui Add, Picture, w200 h400, % A_Temp "\image"
  25.     Gui Show
  26.     WinWaitClose
  27. }
  28.  
  29. Test_GuiClose:
  30. Test_GuiEscape:
  31.    Gui Destroy
  32. return
  33.  
  34. ; https://git.io/JnMcX
  35. #Include WinHttpRequest.ahk
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement