答案 0 :(得分:0)
检查使用此命令是否对您有用:
from bs4 import BeautifulSoup
import requests
import pandas as pd
session = requests.Session()
# urls to loop through
form_urls = ['https://www.sec.gov/Archives/edgar/data/1418814/000141881220000017/vac13f021420.xml',
'https://www.sec.gov/Archives/edgar/data/820124/000095012320003895/408.xml',
'https://www.sec.gov/Archives/edgar/data/1067983/000095012320002466/form13fInfoTable.xml']
# Create dataframe and set columns to match XML doc
cols = ['nameOfIssuer', 'titleOfClass', 'cusip', 'value', 'sshPrnamt',
'sshPrnamtType', 'putCall', 'investmentDiscretion',
'otherManager', 'Sole', 'Shared', 'None',]
res_df = pd.DataFrame(columns=cols)
# Iterate over URLs
for form_url in form_urls:
data = []
soup = BeautifulSoup(session.get(form_url).content, 'lxml')
for info_table in soup.find_all(['n1:infotable', 'infotable']):
row = []
for col in cols:
if form_url == form_urls[0]:
col = "n1:" + col
d = info_table.find([col.lower(), 'ns1:' + col.lower()])
row.append(d.text.strip() if d else 'NaN')
# print(row)
data.append(row)
print(data)
print("==============================================")
url_df = pd.DataFrame(data, columns=cols)
res_df = res_df.append(url_df, ignore_index=True)
print(res_df)
如果此方法有效,并且php C:\ProgramData\ComposerSetup\bin\composer.phar -v
中缺少composer.bat
文件,则必须使用以下内容手动创建该文件:
C:\ProgramData\ComposerSetup\bin
然后,您将可以在命令提示符中使用@echo off
php "%~dp0composer.phar" %*
而不是composer -v
。
我假设您可以执行php脚本,并且您已经向系统中添加了正确的路径,因为如果没有php C:\ProgramData\ComposerSetup\bin\composer.phar -v
并且您没有将路径添加到php可执行文件中,那么这就是首先是造成此作曲家问题的原因。