Jump to content

Reading .JS Text

Recommended Posts


Hello All,

First time here so go easy on me.

I'm trying to get Autoit to getsource or readtext from this URL: http://delivery.vidible.tv/jsonp/pid=5668ae6ee4b0b5e26955d6a6/vid=572083cde4b0b32de8861a8c/56000e19e4b0e4e194b84b31.js

I'd like to use _INetGetSource to pull back all the text on that page so I can use _StringBetween and strip out the video URL: http://videos.vidible.tv/prod/2016-04/27/572083cde4b0b32de8861a8c_640x360_v1.mp4?L4EE7YNrhSWF98gxS0T5cwsKiUhOEKGM0rCdIX_bKHe90F-tC0scswe7NstNEPeq

However, I'm not able to get any text back.  

#include <IE.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <array.au3>

Global $oIE, $wData[5]
Global $dailyURL
Global $updated
Global $weatherData
Global $tempData
Global $windData
$oIE = _IECreate("about:blank", 0, 0, 1, 0)

 Func Huffington()
 Local $queryURL = "http://www.huffingtonpost.com/news/morning-newsbrief/"
    _IENavigate($oIE, $queryURL)
    $huffdata = _INetGetSource($queryURL)
    $dailyURL = _StringBetween($huffdata, '<h3><a href="', '" data-beacon=') ;this gets URL for Daily Morning Newsbrief
    $queryURL2 = $dailyURL[0]
    _IENavigate($oIE, $dailyURL[0]) ;navigates to daily morning newsbrief page
    $huffdata2 = _INetGetSource($queryURL2) ;reads source code of daily morning newsbrief page
    $videoJSURL = _StringBetween($huffdata2, 'src="//delivery.vidible.tv/', '.js') ;gets video js URL
    $videoJSURL = "delivery.vidible.tv/" & $videoJSURL[0] & ".js" ; the URL looks like this: delivery.vidible.tv/jsonp/pid=5668ae6ee4b0b5e26955d6a6/vid=572083cde4b0b32de8861a8c/56000e19e4b0e4e194b84b31.js
    $JSCode = _INetGetSource($videoJSURL)) ;THIS IS THE LINE I CAN'T GET TO WORK
    $RunVideo = _StringBetween($JSCode, 'videoUrls":["', '","')
    Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe -new " & $RunVideo[0])
 EndFunc ;==> Huffington

Any help would be appreciated, thanks!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.