EDIT - I noticed this also applies to the Notes section.
EDIT - I noticed this also applies to the Notes section.
When two Wikipedia pages both link to each other they are usually related in some reasonable way, but unidirectional links give you things like Wikipedia -> California, which only exists because Wikipedia is headquartered in California, a pretty weak connection.
Other than the fact I have it running on an overburdened tiny VPS, my app is also really fast even though I only do a unidirectional BFS because I use a custom in-memory binary format that's mmapped directly from a file that's only 700MB, and a tight search loop written in D.
[1]: http://ratewith.science/#start=Goldeneye&stop=abbotsford
I'm sure there are more classes and tags, but that hopefully should give you a solid place to start.
EDIT - You can also strip out or ignore anything inside of the ordered list for references - <ol class="references">...</ol>
Also, some pages aren't documented in the same way, so something like this page - https://en.wikipedia.org/wiki/X_Window_System - doesn't have any classes or easy way to parse it for the References section even though the Notes section was set up in a more organized way. However, you could take note that the <span> tag contains class="mw-headline" id="References" and the text value is also References and then ignore everything until the next <span> begins.