package mechaml
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Module Mechaml.PageSource
Page
This module contains all the functions used to analyze a page, select specific elements, and manage forms.
The type of an html page
Make a new page from a base URI and a Lambdasoup document
Make a new page from a base URI and an HTML string
Return the resolver of page, which is a function that takes relative URIs of the page to absolute ones using the page base URI
Lazy sequences
Lambdasoup provides lazy sequences to traverse only needed part of an HTML document when used in combination with with_stop. We provide a wrapper that is compatible with Mechaml types such as forms, images, inputs, etc.
Lazy sequences of HTML elements. See Soup.nodes type
Operations on lazy sequences
Form
Images and links
Nodes selection
All the following function are built using the same pattern.
- xxxs (eg
forms) return all the elements of a certain type as a lazy sequence. For example,forms mypagewill return all the forms in the page - xxx_with take a CSS selector as parameter, and return the first element that matches the selector, or
Noneif there isn't any. Eg,link_with "[href$=.jpg]" mypagewill try to find a link that point to a JPEG image - xxxs_with proceed as the previous one, but return a lazy sequence of all elements matching the selector.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page