Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extract python/other programming code from html (converted from Jupyter notebook)
#3
Code:
Copy      Help
// script "财联社.cs"
/*/
nuget -\HtmlAgilityPack;
/*/

using System;
using System.Xml;
using HtmlAgilityPack;
///                    
public class Program
{
    public static void Main()
    {

        
        #region example
            
        var path = @"C:\Users\birdy\Desktop\CIS 512- Car Price Prediction-0719.html";
        
        var doc = new HtmlDocument();
        doc.Load(path);
        
        var node = doc.DocumentNode.SelectNodes("/html/body/div/div[1]/div[2]/div[2]/div/div/pre");
        foreach (var t in node) {
            
            print.it(t.InnerText);
        }

        
        #endregion
    }
}
    
    

[Image: UXapDhs.jpg]

How to replace them with  ' ', " ", >, < Thank you so much!


Messages In This Thread
RE: Extract python/other programming code from html (converted from Jupyter notebook) - by birdywen - 07-25-2023, 03:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)