将BeautifulSoup导入Monkeyrun

2024-05-14 00:56:29 发布

您现在位置:Python中文网/ 问答频道 /正文

有没有一种方法可以将beauthoulsoup(或类似的网络抓取)导入monkeyrunner?在

将beauthulsoup导入Python程序成功。然而,当我向monkeyrunner导入时,我得到了很大的压力

ImportError: No module named bs4

经过一番挖掘,我添加了美丽组路径名

import sys

sys.path.append("path/to/monkeyrunner/directory/the_filename.egg") sys.path.append("path/to/monekeyrunner/directory")

这使Monkeyrunner能够正确地看到BeautifulSoup的目录。但是,对于BeautifulGroup中的某些问题,请参见以下内容:

^{pr2}$

同样,导入到python没有错误。有什么建议可以解释为什么monkeyrunner会这样?在


Tags: topath方法no程序网络sysdirectory