Jump to content
Sign in to follow this  

Need help with _StringBetween

Recommended Posts

Hi there,

I am having some trouble with _StringBetween when learning the basics. Here is the code:

#include <String.au3>

$test = "<p>This is a test</p>"
$abc = _StringBetween($test, "<p>", "</p>")

$file = FileOpen("test.txt", 1)
FileWrite($file, $abc)

I want to get the text "This is a test", and write it into test.txt file, however, the code fails to work and nothing has been written into the file. Something is wrong with _StringBetween, but I can't figure it out. Can anyone help to identify what the problem is?


Share this post

Link to post
Share on other sites

FileWrite($file, $abc[0])

Return Value

Success: A 0 based $array[0] contains the first found string.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


Share this post

Link to post
Share on other sites

Oh, one more thing, I found _StringBetween is really powerful in scraping webpages, really helps me a lot!

Edited by jxn

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...