Parsing HTML Recommendation

Matthias Berth matthias.berth at googlemail.com
Fri Aug 24 21:57:10 UTC 2007


There is a way to provide predefined answers to the popup dialogs, the
Installer package does that, see the bottom of:
  http://wiki.squeak.org/squeak/742

Chasing around a bit in the image leads me to:

BlockContext>>valueSuppressingMessages: aListOfStrings
supplyingAnswers: aListOfPairs

BlockContext>>valueSupplyingAnswers: aListOfPairs
	"evaluate the block using a list of questions / answers that might be
called upon to
	automatically respond to Object>>confirm: or FillInTheBlank requests"

So I guess you have a block with whatever you want to do and some
predefined answers:

[ myUrl extractInfo
  "This may trigger some popups"
] valueSuppressingMessages: {'css error*'. 'doctype error'}
supplyingAnswers: {{'input doctype'. 'XHTML 4.1'}}

The first list contains string patterns for messages that will be
answered with OK, the second is a list of pairs of the form (pattern,
answer) where pattern is a string and answer is any object.

I hope this helps


Matthias

On 8/23/07, Jimmie Houchin <j.squeak at cyberhaus.us> wrote:
> I would love to know if there is a way to silence the dialogs while
> proceeding through the parsing. Yes, I know the markup is awful. Do the
> best you can and it may be good enough for me to do my job. Apparently I
> can do that if if I click, click, click. But I would just like to just
> doit.
>
> I've been doing the work in Python/BeautifulSoup but do not enjoy the
> dead system and would rather be working in a live environment.
>
> Hopefully, I'll get smart enough to use Squeak effectively. :)
>
> Any wisdom on this subject greatly appreciated. I have lots of html
> scraping to do. I don't really need or care about validation and a rich
> interface for this purpose would be great.
>
> Thanks,
>
> Jimmie
>
>
>



More information about the Squeak-dev mailing list