我正在使用scrapy来抓取我拥有的旧网站,我使用下面的代码作为我的蜘蛛.我不介意为每个网页输出文件,或者包含其中所有内容的数据库.但我确实需要让蜘蛛抓住整个事情而不必放入我目前不得不做的每一个网址
import scrapy
class DmozSpider(scrapy.Spider):
name = "dmoz"
allowed_domains = ["www.example.com"]
start_urls = [
"http://www.example.com/contactus"
]
def parse(self, response):
filename = response.url.split("/")[-2] + '.html'
with open(filename, 'wb') as f:
f.write(response.body)
Run Code Online (Sandbox Code Playgroud) 首先,我检查并打开历史模式,我vue-router像这样调用:
const router = new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: routes,
});
Run Code Online (Sandbox Code Playgroud)
我当前所在的路线是/page/item/8,并且我正在重定向到/page/item/9。目前,网址已更改,但页面不会重新呈现,使我保持之前的相同视图。
这个重定向是这样完成的:
this.$router.push({ name: 'PageItem', params: { itemId: '9' }}).catch(err => {
// Stop Vue.router throwing an error if a user clicks on a notification with the same route.
if (err.name !== 'NavigationDuplicated') {
this.$logger.debug.log(err);
}
});
Run Code Online (Sandbox Code Playgroud)
有问题的路线如下:
import PageWrapper from '@/layouts/PageWrapper';
export default [
{
path: '/page',
name: 'page',
component: PageWrapper,
children: [
... Other Routes ...
{
component: () …Run Code Online (Sandbox Code Playgroud) 我正在使用一种样式来设计我的警报对话框,其中大部分的样式如下所示,但多选项目的颜色没有变化。我还想将复选框设置为白色,但不知道该怎么做。
警报对话框:
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(this, R.style.AlertDialogDarkBlue);
builder.setTitle("Faulty Part");
final ArrayList<Integer> selectedFaults = new ArrayList<>();
builder.setMultiChoiceItems(faultsList, null, new DialogInterface.OnMultiChoiceClickListener(){
@Override
public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked) {
if (isChecked) {
// If the user checked the item, add it to the selected items
selectedFaults.add(indexSelected);
} else if (selectedFaults.contains(indexSelected)) {
// Else, if the item is already in the array, remove it
selectedFaults.remove(Integer.valueOf(indexSelected));
}
}
});
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { …Run Code Online (Sandbox Code Playgroud) Okay so this is going to be a long one, but I want to make sure I explain. I am trying to do a proof of concept that we can deploy micro services via ECS that are exposed using API Gateway so we can leverage the lambda authorisers and cognito.
To achieve this I have been following this guide on Medium
However once I deploy my gateway I am faced with the following error:
Cannot GET /node-demo
Run Code Online (Sandbox Code Playgroud)
Let me go …
amazon-web-services amazon-ecs node.js docker aws-application-load-balancer
使用 PHP 7.4 和 Ubuntu 20.04 LTS
我已经使用以下步骤安装了 GRPC:
sudo apt-get install autoconf zlib1g-dev php-dev php-pear
sudo pecl install grpc
Run Code Online (Sandbox Code Playgroud)
cli然后我将以下行添加到显示的文件夹中fpm
extension=grpc.so
/etc/php/7.4/cli/php.ini
/etc/php/7.4/fpm/php.ini
Run Code Online (Sandbox Code Playgroud)
当我运行时,php出现以下错误:
PHP Warning: PHP Startup: Unable to load dynamic library 'grpc.so' (tried: /usr/lib/php/20190902/grpc.so (/usr/lib/php/20190902/grpc.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/grpc.so.so (/usr/lib/php/20190902/grpc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Run Code Online (Sandbox Code Playgroud)
安装后pecl输出已经安装在这里:
/usr/lib/php/20200930/grpc.so
Run Code Online (Sandbox Code Playgroud)
为了变得聪明,我想我可以将文件复制到 php 期望的位置:
sudo cp /usr/lib/php/20200930/grpc.so /usr/lib/php/20190902/grpc.so …Run Code Online (Sandbox Code Playgroud) 我试图让一个查询工作,而不是两个,第一个创建一个数组,然后循环通过另一个.
第一个查询返回一组用户,然后我想基于这些用户查询另一个表,经过一些研究我最终得到了这个但它不起作用......
SELECT FreeText, (
SELECT EmailAddress FROM customers WHERE AccessLevel = 'callcentre'
) AS User FROM orders WHERE FreeText = User
Run Code Online (Sandbox Code Playgroud)
我宁愿做一个单一的查询,但如果那不可能,那么我将使用第一个创建和数组然后循环第二个来解决它
任何帮助赞赏
示例结果,用户将包含名称,例如lsmith,nrowe,pmerle
然后第二个查询将重新转换它们被设置为FreeTxt的订单行
示例表结构
customers table
Id, Email, Add1, Add2 ect...
23, lsmith, someaddress, road...
Orders
Id, customerId, FreeTxt, Product
54, 23, lsmith, mob
Run Code Online (Sandbox Code Playgroud)
这个输出是lsmith + Id来自我在测试时只询问FreeTxt的订单
在 Laravel 文件系统中,您拥有标准 s3 详细信息,如下所示:
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', 'your-key'),
'secret' => env('AWS_SECRET_ACCESS_KEY', 'your-secret'),
'region' => env('AWS_DEFAULT_REGION', 'your-region'),
'bucket' => env('AWS_BUCKET', 'your-bucket'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
Run Code Online (Sandbox Code Playgroud)
我想要建立的是在我的文件系统中列出 2 个磁盘,一个指向我的存储桶上的公共目录,另一个磁盘指向私有位置。
我正在寻找类似的东西:
root_path => '/public'
Run Code Online (Sandbox Code Playgroud) php ×3
amazon-ecs ×1
amazon-s3 ×1
android ×1
aws-application-load-balancer ×1
docker ×1
grpc ×1
java ×1
laravel ×1
mysql ×1
node.js ×1
python ×1
scrapy ×1
sql ×1
ubuntu ×1
ubuntu-20.04 ×1
vue-router ×1
vue.js ×1