Reputation: 13
I'm writing a C# console application that use API of Visual Web Ripper. I wrote a program that worked when I gave specified the file path in the code it self and the code is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualWebRipper;
using VisualWebRipper.Processor;
namespace VisualWebRipperAPI
{
class Program
{
static void Main(string[] args)
{
WrProject project= WrProject.Load("C:\\Users\\User\\Desktop\\news.rip");
project.DataConfiguration.DataSource.OutputFolder =@ "C:\\Users\\User\\Desktop\\output";
project.DataConfiguration.DataSource.IsDefaultOutputFolder = false;
IAgent agent = WrAgent.RunProject(new WrProcessPars(project, false, false, false, project.DefaultCollector, project.LogLevel), true);
string status = agent.Status;
int processedPages = agent.ProcessedPages;
int pageLoadErrors = agent.TimeoutPages;
int missedRequiredElements = agent.MissedRequiredElements;
bool isError = agent.IsError;
Console.WriteLine(status +" "+ processedPages +" "+ pageLoadErrors +" "+ missedRequiredElements +" "+ isError);
Console.ReadLine();
}
}
}
But now I'm trying to change my code to mention the input and output file paths in the object. I added two classes code.cs and program.cs
in code.cs I wrote
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualWebRipper;
using VisualWebRipper.Processor;
namespace webripperplugin
{
public class code
{
public void method(string source,string output)
{
WrProject project = WrProject.Load(source);
project.DataConfiguration.DataSource.OutputFolder = output;
project.DataConfiguration.DataSource.IsDefaultOutputFolder = false;
IAgent agent = WrAgent.RunProject(new WrProcessPars(project, false, false, false, project.DefaultCollector, project.LogLevel), true);
string status = agent.Status;
int processedPages = agent.ProcessedPages;
int pageLoadErrors = agent.TimeoutPages;
int missedRequiredElements = agent.MissedRequiredElements;
bool isError = agent.IsError;
Console.WriteLine(status + "\n" + processedPages + "\n" + pageLoadErrors + "\n" + missedRequiredElements + "\n" + isError);
Console.ReadLine();
}
}
}
And in program.cs I wrote
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualWebRipper;
using VisualWebRipper.Processor;
using webripperplugin;
namespace webripperplugin
{
class Program
{
static void Main()
{
code trail = new code();
trail.method("C:\\Users\\User\\Desktop\\news.rip", @"C:\Users\User\Desktop\output");
}
}
}
But my program in not working as it supposed to be.It is showing two warnings
When I ran it earlier I used to get desired output and now I'm getting no output
Upvotes: 0
Views: 212
Reputation: 6793
Ok so the WebRipper binary targets x86 and you probably have Any CPU
ticked or x64
ensure there is a config for x86
active and that error should go away. You can do that in the project file if you click properties
on the file and change the architecture in the compile tab (platform)
Also try the following:
Any CPU
.Any CPU
then select New
Any CPU
is selected.This needs to be done for both the Debug and Release settings.
Upvotes: 1