I see every code token in a pre
element is surrounded by a span
with styling. How could I, e.g. extract the line:
using MySql.Data.MySqlClient;
from the HTML:
<pre lang="cs" id="pre82739" style="margin-top: 0px;"><span class="code-keyword">using</span> MySql.Data.MySqlClient;</pre>
The extracted code need not include syntax highlighting or other makeup, it must just compile to do the task it is intended to do.
The point of this is building a means to automatically transfer code from web pages, and eventually other devices and formats, to a destination where it can be quickly used, such as send it to Skype where the user can just copy and past it into their code.