小编Sha*_*nga的帖子

在表上刮取<td>值由Javascript生成到Python

我的网络应用程序出现了问题.这是我的代码:

@app.route('/addrec',methods = ['POST', 'GET'])
def addrec():

   if g.user:
        if request.method == 'POST':

#UPPER PANE

            payor = request.form['payor']


            receiptno = request.form['OR']
            paymentmethod = request.form['paymentmethod']
            naive_dt = time.strftime("%m/%d/%Y")
            collectiondate = naive_dt = datetime.now() 
            message = request.form['message']
#LOWER PANE
            url_to_scrape = 'http://localhost:5000/form'
            r = requests.get(url_to_scrape)
            soup = BeautifulSoup(r.text)
            nature = []
            for table_row in soup.select("table.inmatesList tr"):
              cells = table_row.findAll('td')
              if len(cells) > 0:
                nature = cells[0].text.strip()
                natureamt = cells[1].text.strip()
                nature = {'nature': nature, 'nature': natureamt}
                nature_list.append(nature)
            ent = Entry(receiptno, payor,officer, paymentmethod, collectiondate,message, …
Run Code Online (Sandbox Code Playgroud)

html javascript python web-scraping

6
推荐指数
1
解决办法
302
查看次数

main函数不会在haskell中使用任何参数

嗨,我想在haskell中定义一个main函数,类似于java中的main函数

main :: String -> IO()
main args = do
            putStrLn args
Run Code Online (Sandbox Code Playgroud)

但是当我尝试运行程序时,这会给我一个错误.

haskell functional-programming function

3
推荐指数
1
解决办法
126
查看次数

Ocaml连接两个字符串,使a ^ b = b ^ a

我在教科书中发现了一个没有答案的问题.

"找到两个非空字符串a和b,这样a ^ b = b ^ a.通常可以说一对那些通勤字符串?"

我能想到的唯一字符串是a和b是否相同,如"aaa"或"apa".答案很容易还是更复杂?

什么是(^)的类型?如果我只是在utop中输入(^)我得到"bytes - > bytes - > bytes ="但是我猜这个类型必须是String?

ocaml functional-programming

2
推荐指数
1
解决办法
332
查看次数

ALIGN_CENTER 无法解析或不是字段

我哪里错了?

我正在关注本教程:https://www.youtube.com/watch ?v=PvrnbhGeSKE

但是,当我粘贴代码时,Eclipse 给出了这个错误:“ALIGN_CENTER 无法解析或不是字段”

package main;

import entities.*;
import dao.*;
import java.util.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.*;

public class Main {

    public static void main(String[] args) {

        try {
            ProductModel pmodel = new ProductModel();
            HSSFWorkbook workbook = new HSSFWorkbook();
            HSSFSheet sheet = workbook.createSheet("List Products");

            Row rowheading = sheet.createRow(0);
            rowheading.createCell(0).setCellValue("Id");
            rowheading.createCell(1).setCellValue("Name");
            rowheading.createCell(2).setCellValue("Creation Date");
            rowheading.createCell(3).setCellValue("Price");
            rowheading.createCell(4).setCellValue("Quantity");
            rowheading.createCell(5).setCellValue("Sub Total");
            for (int i = 0; i < 6; i++) {
                CellStyle stylerowHeading = workbook.createCellStyle();
                Font font = workbook.createFont(); …
Run Code Online (Sandbox Code Playgroud)

java apache-poi jakarta-ee

0
推荐指数
1
解决办法
9088
查看次数