Bahman Movaqar wrote on 06/21/2015 01:35 PM:
     (define html-doc (html->xexp html-as-string))
     ((txpath "//li[@id='SOME-ID']") html-doc)

I'm glad that worked. BTW, the above is a perfectly fine script, but I just remembered something to point out for people finding this email thread in the future... I often see people get misled by example code, and do things like call `(txpath "//li[@id='SOME-ID']")` numerous times in a real-world program. For performance, they usually only want to do that call to `txpath` once within a program, and store the result to a variable that they then reference multiple times -- since `txpath` is a somewhat expensive pure function, that produces a pure function, and you can reuse the latter procedure infinitely.

Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to