如何将数据从网站提取到Excel?
从现场来看,有以下值(位于中间): 我想知道如何将值提取到Excel“或任何程序”中,因此列“A”是“项EAN”的列表(这不是变量,我手动输入),列“B”是“卖方:”值的提取数据(这是变量) 你能帮我吗 我想我们可以用宏来做这个 像这样的如何将数据从网站提取到Excel?,excel,web,Excel,Web,从现场来看,有以下值(位于中间): 我想知道如何将值提取到Excel“或任何程序”中,因此列“A”是“项EAN”的列表(这不是变量,我手动输入),列“B”是“卖方:”值的提取数据(这是变量) 你能帮我吗 我想我们可以用宏来做这个 像这样的 Sub queryURL() myURL = "URL;http://a810-bisweb.nyc.gov/bisweb/PropertyProfileOverviewServlet?boro=" & Range("A1") & "&
Sub queryURL()
myURL = "URL;http://a810-bisweb.nyc.gov/bisweb/PropertyProfileOverviewServlet?boro=" & Range("A1") & "&houseno=" & Range("A2") & "street=" & Range("A3") & "&go2=+GO+&requestid=0&t10=y"
With ActiveSheet.QueryTables.Add(Connection:=myURL, Destination:=Range("A9"))
End With
End Sub
以下是示例代码:
import java.io.File;
import jxl.*;
import jxl.write.*;
/**
*
* @author Guokai.Wang
*/
public class ExcelCreator
{
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
// TODO code application logic here
Cell cell;
EN n1 = new EN(0, 3, 1.00);
Label label = new Label(0, 2, "A label cell");
// NumberFormat n_f = new NumberFormat(NumberFormat.CURRENCY_DOLLAR);
// WritableCellFormat currencyFormat = new WritableCellFormat(n_f);
WritableSheet sheet;
WritableWorkbook book;
try
{
book = Workbook.createWorkbook(new File("test.xls"));
sheet = book.createSheet("First", 0);
// n2 = new EN(0, 4, f, currencyFormat);
sheet.addCell(label);
sheet.addCell(n1);
// sheet.addCell(n2);
cell = sheet.getCell(0, 2);
System.out.println(cell.getContents());
book.write();
book.close();
}
catch(Exception exception) {exception.printStackTrace();}
}
}
您必须下载jxl.jar,这是Java代码。这个问题与Java无关。
import java.io.File;
import jxl.*;
import jxl.write.*;
/**
*
* @author Guokai.Wang
*/
public class ExcelCreator
{
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
// TODO code application logic here
Cell cell;
EN n1 = new EN(0, 3, 1.00);
Label label = new Label(0, 2, "A label cell");
// NumberFormat n_f = new NumberFormat(NumberFormat.CURRENCY_DOLLAR);
// WritableCellFormat currencyFormat = new WritableCellFormat(n_f);
WritableSheet sheet;
WritableWorkbook book;
try
{
book = Workbook.createWorkbook(new File("test.xls"));
sheet = book.createSheet("First", 0);
// n2 = new EN(0, 4, f, currencyFormat);
sheet.addCell(label);
sheet.addCell(n1);
// sheet.addCell(n2);
cell = sheet.getCell(0, 2);
System.out.println(cell.getContents());
book.write();
book.close();
}
catch(Exception exception) {exception.printStackTrace();}
}
}