Is there a robust/general way in eww
browser (or alternatively w3m
in emacs) by which I can get the character position in a rendered page from a known character position in the page source?
I'd like to use this to automatically jump to "important" parts of webpages I visit often.
On stackexchange.com I need to scroll down a whole page to see the relevant part (the question section). I would like to setup emacs to jump automatically to the section.
As an example, stackoverflow.com has a question header:
<h1 itemprop="name" class="grid--cell fs-headline1 fl1">
<a href="..." class="question-hyperlink">
Stack overflow question title
</a>
</h1>
If I can find this location by html tags in the source, is there a way to then jump to get the corresponding position in the rendered page view.
M-x fundamental-mode
and inspect what it looks like afterw3m
converted it. You then have two choices, intercept the page before it gets converted and do something with it that suits your needs, or deal with it after it has been converted and you know what to search for. Note that there are lots ofw3m
options that I have observed in the source code for rendering things like email, so changing the options to suit your needs may also be something to research.w3m
handles a "NO-BREAK SPACE" aka character code 160. I first change it to a semi-rare ascii character, and then letw3m
do its thing, and then I change the semi-rare character into my preferred character; e.g., a regular space. If you have a repeating fact pattern, you can insert a preferred/special character or the like to find it quickly with a jump/search ... Now, there may bew3m
command line options to deal with special characters in a preferred way -- I just haven't studied those options.