Jump to content

Recommended Posts

Posted

I want to pull random text from lipsum

It dosnt need to fill anything out on there homepage just needs to go to http://lipsum.com/feed/html

this is the program I have so far but its very primative and if you could help that would be great.

#include <IE.au3>
#Include <ScreenCapture.au3>
#include <Excel.au3>
#include "array.au3"
#Include <File.au3>
#include <INet.au3>

$oIE = _IECreate ("http://lipsum.com/feed/html", 0, 0, 0);Opens source for random text
_IELoadWait ($oIE);Waits for webpage to load

$sText = _IEBodyReadText ($oIE)

$RandomText1 = Stringleft($sText, 50);
$RandomText = StringRight($RandomText1, 200)

$file = fileopen("Text.txt", 1);
filewrite($file, $RandomText);
sleep (1000);
FileClose($file);
_IeQuit ($oIE);

thank you all help is appreciated my only issue with this program is that it only pulls a few of the digits.

please help pull more accuratly.

thanks

Posted

I want to pull random text from lipsum

It dosnt need to fill anything out on there homepage just needs to go to http://lipsum.com/feed/html

this is the program I have so far but its very primative and if you could help that would be great.

#include <IE.au3>
#Include <ScreenCapture.au3>
#include <Excel.au3>
#include "array.au3"
#Include <File.au3>
#include <INet.au3>

$oIE = _IECreate ("http://lipsum.com/feed/html", 0, 0, 0);Opens source for random text
_IELoadWait ($oIE);Waits for webpage to load

$sText = _IEBodyReadText ($oIE)

$RandomText1 = Stringleft($sText, 50);
$RandomText = StringRight($RandomText1, 200)

$file = fileopen("Text.txt", 1);
filewrite($file, $RandomText);
sleep (1000);
FileClose($file);
_IeQuit ($oIE);

thank you all help is appreciated my only issue with this program is that it only pulls a few of the digits.

please help pull more accuratly.

thanks

check out StringRegExp to identify and extract the text elements that you want
Posted

I came up with this, sortof quickly.. I believe I will take this somewhere, maybe it'll be of some use for you as well..

#include <INet.au3>
#include <String.au3>

$vLoremText = _StringBetween(_INetGetSource('http://lipsum.com/feed/html'), '<div id="lipsum">', '</div>')
MsgBox(0, "", StringReplace(StringReplace($vLoremText[0], '</p>', ''), '<p>', ''))

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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
×
×
  • Create New...