Jump to content

Recommended Posts

  • Moderators
Posted

horne,

Then amend the line to read: :)

$aExtract = StringRegExp($sHTML, '(?U)<span class="title">(.*)</span>', 3)

No, see what i post

And with that attitude that is the end of my assistance. :bye:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

It still output the whole HTML code, not the content i want between the title span. When i find way out i will post.

Posted

I`ve got it, it must be used _StringBetween, the problem now is that its return me nothing, unless it used with _ArrayDisplay hmmmm.....

I will have to work on it.

some testing code

#include <IE.au3>
#include <String.au3>
#include <Array.au3>
Local $vboxcode = InputBox("Vbox7 downloader", "Enter vbox7 code.", "", " ")
Local $oIE = _IECreate ($vboxcode, 0, 0, 1, 0)
Local $sHTML = _IEBodyReadHTML($oIE)
;###Local $sExtract2 = StringRegExpReplace($sHTML, '(?U)<span class="title">(.*)</span>', "$1")
Local $sExtract3 = _StringBetween($sHTML,'<span class="title">','</span>')
Local $extractarray =  _ArrayDisplay($sExtract3, 'Default Search')
_IEQuit($oIE)
;###MsgBox(0, "Test", $sExtract2, 1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sExtract2 = ' & $sExtract3 & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $extractarray = ' & $extractarray & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Posted (edited)

I`ve got it, it must be used _StringBetween, the problem now is that its return me nothing, unless it used with _ArrayDisplay hmmmm.....

I will have to work on it.

some testing code

...

Stringregex works fine. I posted a tool so you rapidly test expressions to see how it works. You gave no indication of trying it. It really is not too hard as long as it is the right tool for the job, in this case it is. Anything can be hard when you decide not to understand it.

The help file is your friend. The way you are going about things, soon may be your only friend.

Edited by DicatoroftheUSA
Posted

Lol, strange :D i can`t see how i offended you guys, seems i have in some kind of a way, i appreciate the help and the support you give

DicatoroftheUSA i am already using the tool

and i am using a lot the help ! Actually this is the way i am learning this language ...

The the point i am trying to reach is that Stringregex and Stringregexpreplace are for cutting something from the array or at least that is what i am understanding and seeing from the tests. But i need ONLY the code between the <span class="title"> which in our case is the name of the video from the webpage ...

so i am trying to get like $var = "Name of the video"

When i use _StringBetween it gives me exatly what i need, but i dont know how to output it in variable.

Apologise again if somehow i ofended someone i am total rookie here

Posted

Here it is the fully working code:

#include <IE.au3>
#include <String.au3>
#include <Array.au3>
Local $vboxcode = InputBox("Vbox7 downloader", "Enter vbox7 code.", "", " ")
Local $oIE = _IECreate ($vboxcode, 0, 0, 1, 0)
Local $sHTML = _IEBodyReadHTML($oIE)
Local $sExtract3 = _StringBetween($sHTML,'<span class="title">','</span>')
Local $extractarray2 =  _ArrayToString($sExtract3)
_IEQuit($oIE)
MsgBox(4096, "Videoname", $extractarray2, 10)
  • Moderators
Posted

horne,

Apology accepted. :)

I have looked at the HTML returned and this more specific pattern works for me on the only <span class="title"> I can find in there:

$aRet = StringRegExp($sHTML, '<div class="titleBar_Title"><span class="title">(.*)</span></div>', 3)

If IsArray($aRet) Then
    ConsoleWrite($aRet[0] & @CRLF)
Else
    ConsoleWrite("Nowt" & @CRLF)
EndIf

Does that give you the string you are looking for? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

  • Moderators
Posted

horne,

Glad we got there in the end. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...