master
poni 1 year ago
parent fe499adf1d
commit 2c7c575d33

@ -1,248 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "bbf97edb-4082-49fd-9946-56aa3f3d0eb4",
"metadata": {},
"outputs": [],
"source": [
"import selenium \n",
"from selenium import webdriver\n",
"from selenium.webdriver.common.by import By\n",
"import time\n",
"import requests\n",
"import os\n",
"import io\n",
"import json\n",
"import random\n",
"import json\n",
"from selenium.webdriver.chrome.service import Service\n",
"from webdriver_manager.chrome import ChromeDriverManager\n",
"\n",
"DRIVER_PATH = '../../geckodriver'\n",
"DRIVER_PATH2 = '../chromedriver'"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "d53ab4b1-da92-4ae2-ae11-02fa2d8ffe7c",
"metadata": {},
"outputs": [],
"source": [
"def harvesting(query:str, max_links_to_fetch:int, wd:webdriver, sleep_between_interactions:int=1):\n",
" dictionary = open('axios-example/pics.json',)\n",
" l = json.load(dictionary)\n",
" \n",
" cycles = 10\n",
"\n",
" def scroll_to_end(wd):\n",
" wd.execute_script(\"window.scrollTo(0, document.body.scrollHeight);\")\n",
" time.sleep(sleep_between_interactions) \n",
" \n",
" # build the google query\n",
" search_url = \"https://www.google.com/search?safe=off&site=&tbm=isch&source=hp&q={q}&oq={q}&gs_l=img\"\n",
"\n",
" # load the page\n",
" wd.get(search_url.format(q=query))\n",
"\n",
" image_urls = set()\n",
" image_count = 0\n",
" results_start = 0\n",
" \n",
" sx =\"sx\"\n",
" dx=\"dx\"\n",
"\n",
" \n",
" while image_count < max_links_to_fetch:\n",
" for loop in range(cycles):\n",
" scroll_to_end(wd)\n",
" time.sleep(.1)\n",
"\n",
" # get all image thumbnail results\n",
" thumbnail_results = wd.find_elements(By.CLASS_NAME,\"Q4LuWd\")\n",
" number_results = len(thumbnail_results)\n",
" print(f\"Found: {number_results} search results. Extracting links from {results_start}:{number_results}\")\n",
" \n",
" # some useful variables\n",
" nPic = 0\n",
" holdPic=0\n",
" groundPic = 0\n",
" currentMeta = ''\n",
"\n",
" \n",
" for img in thumbnail_results[results_start:number_results]:\n",
" # click the thumbnail to get the actual image\n",
" try:\n",
" img.click()\n",
" time.sleep(.1)\n",
" except Exception:\n",
" continue\n",
"\n",
" # extract image url\n",
" actual_images = wd.find_elements(By.CLASS_NAME,'n3VNCb')\n",
" try:\n",
" actual_image = actual_images[-1]\n",
" except Exception:\n",
" continue\n",
" if actual_image.get_attribute('src') and 'http' in actual_image.get_attribute('src'):\n",
" image_urls.add(actual_image.get_attribute('src'))\n",
" linkPic = actual_image.get_attribute('src')\n",
" #\n",
" # print(linkPic)\n",
" \n",
" l[nPic] = linkPic\n",
" time.sleep(.5)\n",
"\n",
" # print(l) \n",
"\n",
" \n",
" with open(\"axios-example/pics.json\", \"w\") as outfile: \n",
" json.dump(l, outfile) \n",
" \n",
" nPic = nPic+1\n",
"\n",
" holdPic = holdPic+1\n",
" time.sleep(.5)\n",
"\n",
" image_count = len(image_urls)\n",
"\n",
" if len(image_urls) >= max_links_to_fetch:\n",
" print(f\"Found: {len(image_urls)} image links, done!\")\n",
" break\n",
" else:\n",
" print(\"Found:\", len(image_urls), \"image links, looking for more ...\")\n",
" time.sleep(1)\n",
" return\n",
" load_more_button = wd.find_element(By.CLASS_NAME,\"Mye4qd\")\n",
" if load_more_button:\n",
" wd.execute_script(\"document.querySelector('.mye4qd').click();\")\n",
"\n",
" # move the result startpoint further down\n",
" results_start = len(thumbnail_results)\n",
"\n",
" return image_urls"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "6de53389-ded8-47e2-b0aa-c132405a308f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found: 281 search results. Extracting links from 0:281\n",
"Found: 260 image links, looking for more ...\n"
]
}
],
"source": [
"if __name__ == '__main__':\n",
" wd = webdriver.Chrome(service=Service(ChromeDriverManager().install()))\n",
" query = \"VAAST COLSON\"\n",
" wd.get('https://google.com')\n",
" time.sleep(1)\n",
" wd.find_element(By.ID,'W0wltc').click()\n",
"\n",
" time.sleep(.5)\n",
" \n",
" search_box = wd.find_element(By.CLASS_NAME,'gLFyf')\n",
" search_box.send_keys(query)\n",
" \n",
" links = harvesting(query,300,wd)\n",
" \n",
" wd.quit()"
]
},
{
"cell_type": "code",
"execution_count": 90,
"id": "e2f2b34f-ab75-41d4-82ff-e69b8c0c4481",
"metadata": {},
"outputs": [],
"source": [
" #if (nPic%2):\n",
" # wd2.execute_script(f\"document.querySelector('.scene3D').innerHTML += '<div><img class={dx} style={pos} id=pic{nPic} src={linkPic}></div>'\")\n",
" # else:\n",
" # wd2.execute_script(f\"document.querySelector('.scene3D').innerHTML += '<div><img class={sx} style={pos} id=pic{nPic} src={linkPic}></div>'\")\n",
" #if (holdPic == 50):\n",
" # for rPic in range(groundPic,groundPic+10):\n",
" # try:\n",
" # wd2.execute_script(f\"remove('pic{rPic}')\")\n",
" # except:\n",
" # print('eheh')\n",
" # groundPic = groundPic+10\n",
" # holdPic = 0"
]
},
{
"cell_type": "code",
"execution_count": 68,
"id": "ba2a67d3-8958-48eb-8f98-7d7d97d61706",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"View Vaast Colson's artworks on artnet. Learn about the artist and find an in-depth biography, exhibitions, original artworks, the latest news, ...\n",
"Biography Vaast Colson (Kapellen, Belgium, 1977) Lives and works in Antwerp, Belgium. Monopolis — Antwerp. 10 September — 6 November 2005. Exhibition.\n",
"Vaast Colson (°1977, Belgium) Vaast Colson's artworks are essentially ludic models of social spaces. His projects place the spectators into a certain social ...\n",
"Stay up to date with Vaast Colson (Belgian, 1977), APT artist. Discover works for sale, auction results, market data, news and exhibitions on MutualArt.\n",
"Browse the latest artworks, exhibitions, shows by Vaast Colson. On Artland you can find art for sale, browse 3D gallery exhibitions and much more.\n",
"Vaast Colson MAES & MATTHYS GALLERY Antwerp. 29. Nov 22. Feb 2009. Un-Scene WIELS Contemporary Art Centre, Brussels. 19. Oct 04. Jan 2009.\n",
"Vaast Colson and Kati Heck “Show me yours & I'll show you mine” at Museum of Contemporary Art Antwerp. 15.05.2016. Reading Time 2. Share.\n",
"MOSTRE ED EVENTI CHE RIGUARDANO Vaast Colson. TUTTIIN CORSOCONCLUSIFUTURI. Sanguine. Luc Tuymans on Baroque. Dal 17 ottobre 2018 al 25 febbraio 2019\n",
"Vaast Colson (Kapellen, 1977) is een Belgisch kunstschilder. Hij studeerde schilderkunst aan de Koninklijke Academie voor Schone Kunsten van Antwerpen.\n",
"Vaast Colson about his drawing activities, on the occasion of The Big Draw in Antwerp. www.thebigdraw.be Sine Van Menxel's solo exhibition, Fencing a...\n"
]
}
],
"source": [
"import json \n",
"dictionary = open('/meta.json',)\n",
"l = json.load(dictionary)\n",
"for x in range(10):\n",
" print(l[str(x)])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c5d60578-9ce2-491b-be89-4a4dc3cc1203",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
},
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"nbformat": 4,
"nbformat_minor": 5
}

File diff suppressed because one or more lines are too long

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

@ -1,2 +0,0 @@
*.pyc
/.venv/*

@ -1,241 +0,0 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)
<# Function declarations --------------------------------------------------- #>
<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}
# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}
# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}
# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}
# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}
<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }
if ($pyvenvConfigPath) {
Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]
# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}
$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}
<# Begin Activate script --------------------------------------------------- #>
# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}
# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}
Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"
# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Verbose "Setting prompt to '$Prompt'"
# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
}
# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}
# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"

@ -1,66 +0,0 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/fmc_mac4/harvesting_the_net/axios-example"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(axios-example) ${PS1:-}"
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

@ -1,25 +0,0 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/fmc_mac4/harvesting_the_net/axios-example"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(axios-example) $prompt"
endif
alias pydoc python -m pydoc
rehash

@ -1,64 +0,0 @@
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
# (https://fishshell.com/); you cannot run it directly.
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/fmc_mac4/harvesting_the_net/axios-example"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset PYTHONHOME if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# Save the current fish_prompt function as the function _old_fish_prompt.
functions -c fish_prompt _old_fish_prompt
# With the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command.
set -l old_status $status
# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(axios-example) " (set_color normal)
# Restore the return status of the previous command.
echo "exit $old_status" | .
# Output the original/"old" prompt.
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

@ -1,8 +0,0 @@
#!/Users/fmc_mac4/harvesting_the_net/axios-example/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from flask.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -1,8 +0,0 @@
#!/Users/fmc_mac4/harvesting_the_net/axios-example/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -1,8 +0,0 @@
#!/Users/fmc_mac4/harvesting_the_net/axios-example/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -1 +0,0 @@
/Library/Developer/CommandLineTools/usr/bin/python3

File diff suppressed because it is too large Load Diff

@ -1,4 +0,0 @@
source bin/activate
flask run -p 6969 &
python3 ./meta.py &
python3 ./pics.py

@ -1,57 +0,0 @@
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import requests
import os
import io
import multiprocessing
import json
DRIVER_PATH = '../geckodriver'
DRIVER_PATH2 = '../chromedriver'
def meta(queries,wd3):
url = 'https://www.google.it/search?q=vaast+colson&sxsrf=ALiCzsYcMyMvNo67pjpN-zRgfmTXw1L6Zw%3A1670252242664&source=hp&ei=0gaOY7zUJfbjxc8Pu_2QmAE&iflsig=AJiK0e8AAAAAY44U4oHBLhsJUz-SOp-oMy5eO2PMIDLU&gs_ssp=eJzj4tVP1zc0TDKvMDJMqjQzYPTiKUtMLC5RSM7PKc7PAwB8eAkY&oq=vaast+colsan&gs_lcp=Cgdnd3Mtd2l6EAEYADIHCC4QgAQQDTIGCAAQHhANMgYIABAeEA0yBggAEB4QDTIGCAAQHhANMggIABAIEB4QDToECCMQJzoLCC4QgAQQxwEQ0QM6CAguENQCEIAEOggILhCABBDUAjoFCAAQgAQ6BQguEIAEOgsILhCABBDHARCvAToOCC4QgAQQxwEQ0QMQ1AI6CAguEIAEEMsBOggIABCABBDLAToLCC4Q1AIQgAQQywE6DgguEK8BEMcBEIAEEMsBOgoIABCABBAKEMsBOgcIABCABBAKOgYIABAWEB46CAgAEBYQHhAKOgUIABCGA1AAWMkOYK0XaAFwAHgBgAHhAogB-RKSAQcxLjYuNS4xmAEAoAEB&sclient=gws-wiz'
wd3.get(url)
wd3.find_element(By.ID,'W0wltc').click()
dictionary = open('meta.json',)
l = json.load(dictionary)
print(l)
print('jsonjson!')
i=2
n = 0
while True:
try:
wd3.find_element(By.CSS_SELECTOR, "a[aria-label='Page {}']".format(i)).click()
searchResults = wd3.find_elements(By.CLASS_NAME, 'VwiC3b')
for result in searchResults:
#l = ''
l[n] = result.text
time.sleep(.5)
print(l)
n=n+1
with open("meta.json", "w") as outfile:
json.dump(l, outfile)
time.sleep(.5)
#wd2.execute_script(f"document.querySelector('#text').innerHTML += {result.text}")
print("Navigating to Next Page " + str(i))
i=i+1
time.sleep(1)
except:
print("Last page reached")
break
wd3 = webdriver.Chrome(executable_path=DRIVER_PATH2)
queries = ["VAAST COLSON"]
meta(queries,wd3)

@ -1,209 +0,0 @@
{
"0": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQbNjc25uO7NAC1AVitwxh-O3ee4QUtgO_tPQ&usqp=CAU",
"1": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRDPJaJ1nIQAGNIopD-HjsmVy9KahcOvg-oCQ&usqp=CAU",
"2": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRY0pO2Kml4MH5GEK7QDRtXUgjR0LKGtIn0Yg&usqp=CAU",
"3": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcvfQsHyXebb5ozXOc_wKtLVC3AHejYrgxPg&usqp=CAU",
"4": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQSGcRPBPiONWQENsS1JZrVcq0wOz_z7UR1OA&usqp=CAU",
"5": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRA5B6YzNZRMdifODu-gphOdDydfMzIARaBpw&usqp=CAU",
"6": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQqYmtLa9qGEnLNqF_eCddfrrar4tfmfbKn1w&usqp=CAU",
"7": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTkG_izkc0CpL0PqjYQSkb2UN6kvt_KDVCG9g&usqp=CAU",
"8": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTZkCfvF3BQ6KNS38Lf3wvbTKG5AurCN8UgqQ&usqp=CAU",
"9": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTLvOk39BlgcvhzIPMxNI4Ua8fO7rORj5QayA&usqp=CAU",
"10": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTgQrfB_HbvhLjSsh66S5vmuRpTLcnvwhQuKA&usqp=CAU",
"11": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTqBbc2P0pyQW5diec1nu-sWqlPvbDUcIt_OA&usqp=CAU",
"12": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR3uX4qd_ynA8B9ADs8mJY3yEUec40wcyyRqA&usqp=CAU",
"13": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNEbssZH9M9Z6KFnuPTeF7QEB20oarKgVbog&usqp=CAU",
"14": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQaFtprJMViJ3YPcNMbHEAYGd583hc0WI87Vw&usqp=CAU",
"15": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQZqbzo8BzUgs6cwViiLsd8rW5XJifwsx-unA&usqp=CAU",
"16": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRB17dIlgEdNVsMlqgNdFbs-yXhEx9fue2Kxg&usqp=CAU",
"17": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8UdswoG_iE_se_6sXP-W-W4vuTf7l33YIvw&usqp=CAU",
"18": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQS8PqSywS1bB7nYBRp3p71ylGE2IH4F2mBhw&usqp=CAU",
"19": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQvuRpFrKbSAWFX1G8vL4tQQP32L35V_8rI5A&usqp=CAU",
"20": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSasNqfx8g_-ED7RJ2Iwlwktk3l3bl5fmAZ-w&usqp=CAU",
"21": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrL6Uf5-dmFpvkrW2-WJazoqo3SefcU9IqLw&usqp=CAU",
"22": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSydvup97dUZN5YWXYvkZ44QKezVmd9gvf1sA&usqp=CAU",
"23": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrm3F11VH7Bd3SZCti-dBGKf_Zd-S4gfzWAQ&usqp=CAU",
"24": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRtMkKA4TdzrjhZ0IfekAsCbivT-KeI5MxzQA&usqp=CAU",
"25": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSauJslhqnzNBBe4x-ejOq_E3Ur6DjBNTxoSA&usqp=CAU",
"26": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQUKFZHSy94mzLoz_viHIGwprZGj2_z5grycA&usqp=CAU",
"27": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT9kJVVKQZhSx3Qy6fZ4-NYnKTV99C-fKhhKw&usqp=CAU",
"28": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxDsjJsdNhsuODi1ZW8qv9flEAUwPSU7Jd9g&usqp=CAU",
"29": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTwj2ubqDCWMQZO8BoXI8Fi-EP55eETPkBnnw&usqp=CAU",
"30": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRqhqp_ApZj3XGtlovlk1SYrTSQH1eJv_mftA&usqp=CAU",
"31": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSfGlCrrYvJykKux1WjoJFMNSMKfoPtwf_S0g&usqp=CAU",
"32": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2pfMMKtAeg3SmoPvu-YV6pYBwzpFTdZNrHg&usqp=CAU",
"33": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTKj2OhPuC_BQKb5Dql64mqPfJZDzgwoUu7Bg&usqp=CAU",
"34": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSIaPP90Ci2MhSo9t7WCbIzPEDUes5T05oZmA&usqp=CAU",
"35": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSG3K2Z0-zKcl6KfnIkMUWI2GXsgPRmAlQWPg&usqp=CAU",
"36": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcThH_4tlyq3SkILHbuyhsYFI922VK__rUFvTg&usqp=CAU",
"37": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTMlo4GMeVM8iyjRjhgyhXwN11ER9XfIFTOTA&usqp=CAU",
"38": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQioW0TyTNr_OIt0kHzffsPwGsC50yoo2GOMg&usqp=CAU",
"39": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQdOp4HKY-OGwacua9pYPgwC5le4IWj5NKVXg&usqp=CAU",
"40": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT8QgubrxEuV7tV3d-iSbXi4mS79-QyYB0Kig&usqp=CAU",
"41": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT27EgeOPDFnCBVVufk6Cwc4VhElyDaDfOmow&usqp=CAU",
"42": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQMrnRkKCYbemI0fdVj2I8kARudAFwSiGVHw&usqp=CAU",
"43": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR64TGDt2ff6d_oGdvcFl7HOT_v93wP22ldKA&usqp=CAU",
"44": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR64TGDt2ff6d_oGdvcFl7HOT_v93wP22ldKA&usqp=CAU",
"45": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhzsUYANumtnNLoMjic7SxzuMXCr8YnrK-1g&usqp=CAU",
"46": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTgYHblLR4oqQsOXgwND9agpkB-hAfTPXGjtA&usqp=CAU",
"47": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTHH4VPTvV_QD56Rtu4pf9INQv7B3hHqMNzJg&usqp=CAU",
"48": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSEZssIZHIP46o6B3OHr-DJ5ntoxtZh0RVi9A&usqp=CAU",
"49": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSil_oO-mvqwMUvBdiP-xPin0F3UlUMiTBXCQ&usqp=CAU",
"50": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQFy9QzW3lN-mibGlX1HTC_8ZQcoz_WvMuH1g&usqp=CAU",
"51": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT63NQ9bSD_3zCNFuKGwPty27G0IcmF8w4KUA&usqp=CAU",
"52": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTS_vS001A-gCmaa7B6XSkYzlXxvddXgtOm2w&usqp=CAU",
"53": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ7Z0W2HKV_7u5jDkKs3AuueeCshvcluF4mbw&usqp=CAU",
"54": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSyiV4sOHOGgGi2xmWc7mOwRu3JSbNnVss7zw&usqp=CAU",
"55": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRZakjdVV0it1DHgTOHTifSNkqHm44B_eo0dw&usqp=CAU",
"56": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTCIaOyt1Kd1NW0cYDLf7h_pNEf_XHlmDhMgA&usqp=CAU",
"57": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTu-1EahSgwRf6_16tr19RDei327hsXtktZcg&usqp=CAU",
"58": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjoUAWfzImGrlkvrDzzwLHxpDOvkSXTk8RSA&usqp=CAU",
"59": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTipa6DwdTck4xt_MuqCIoKwkB2na2ndtgwoA&usqp=CAU",
"60": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRk1ETGYUrvRspMwGwIZRh2jT5pAg5w-YX50Q&usqp=CAU",
"61": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRED4OSHtwT8LB1BtyLnmxZc_QP3CehhjUg9g&usqp=CAU",
"62": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ9w20GRm5pfY8lNlNA1kSOC1493Cnocaae3w&usqp=CAU",
"63": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3ttImHOxUhPG2G6whXQyoSOH6HhKDzDhljw&usqp=CAU",
"64": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSPgrpGL4FDASAHwJV_LYRY46ZJCxaWOVjGWw&usqp=CAU",
"65": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRzPHWLsWlfXDugsdRe67Bl_By5GB66glR4CA&usqp=CAU",
"66": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQh_ikOZ2uH0OreJMC7Z1lTcUiVQING-VeIvw&usqp=CAU",
"67": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR9-thnIzZ4SE5soPu6O0f5o-QklwV-9mCKlQ&usqp=CAU",
"68": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQMMXqTMcqXYoxY_EgC1k749s0WJ3-CXSJlbg&usqp=CAU",
"69": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTq4medtOuzYpHGb22aHQIYSf-LpHWCUyGJ8A&usqp=CAU",
"70": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3Iafrc7-HmDmdzFOZIJ2ahaTlJnPl5u7F0w&usqp=CAU",
"71": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQamikTkkGeKWFmHmfsceg4b_YQNpImXLqD9Q&usqp=CAU",
"72": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcRodjJzh2P7AzhA1UMp8x3nfoCMiiDDDO4Q&usqp=CAU",
"73": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6pIiAkF7dvC-iP87J-ShQNbg2_NX50yIkVQ&usqp=CAU",
"74": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRFo5jOsLDIHYxUrLhCXropSukop7nTRHozxA&usqp=CAU",
"75": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8RPEakZXFwiqEjIbGYG8l65lGaMlHrKamew&usqp=CAU",
"76": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRcMeoqfUT5nOom5RJr-qMvYfwUKTkqSLjN4w&usqp=CAU",
"77": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFxcU3BzbJbBPXkRzh6sXvrfX5FkXDPVzMgQ&usqp=CAU",
"78": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS-hKQ3zPxiqfVoCbKwn66H-b_q0n5c8y8W6A&usqp=CAU",
"79": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTMbvHRJmh6FJZA7znoX9kzWmyiSuSqs3BJ9Q&usqp=CAU",
"80": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRs6ja7Tq1NkRci6FhGbO2WN5g5bz0dcMns37yDThdKy0tPtzSwpH_832cryCbtCpK3XHY&usqp=CAU",
"81": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSuMGthta1Pl5ssv5d4uxBjEOhmfKO8n7H7-KtcJHUv-qa7QqXtTw_OPaKxapI4jsZhYio&usqp=CAU",
"82": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQUpztBFIHuiL0gQ6F2PT1cFKEs9HPoO8d7pX9CtB3-zAQfdEFMWaIT76CioBdrrFqbfig&usqp=CAU",
"83": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTHBN7A-UdUTreezteXdF4TZPPFjMK3z4AnkHquYLOll77Gnic6h9pK90oBOjZe73ktjig&usqp=CAU",
"84": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRBGfYHImSF7YpkGXf_Epjd789qdvTg208856cD1QiwQpf_LVNlxfMjAtxyIziy9i-NgBg&usqp=CAU",
"85": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeeM3eJRYM0iIKQV7s7aKaRtugQv7p9vaJVfq22YV2Mp4t53CMvKRHnFiwXvV3UuXCIiI&usqp=CAU",
"86": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSI7WkpI7XOe7OLgpSYxSxZUNkjjqw9myp_lznG0vGoPCPk_u31MUu46cL5EF1dFh0nxFk&usqp=CAU",
"87": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRhRGcvKQ82X1d9_WLQw8k4Jrh11QLgF8i2KOQz57eeEbCK58fzz0MFYlWARSONrL39Ag&usqp=CAU",
"88": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTgYH9QpQccvE4PG6ny68p1BhBx8ceLiimfQrqr5L_ZLaj68_HBMSaf4bU8M3f318yvfG8&usqp=CAU",
"89": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQE6smeemvuJjO3IHf3a22Cs5ArbrETVIWqATOK66nPJ4a2v9APsMS1hAHwHOQRn6qQ4Pc&usqp=CAU",
"90": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQXPJObvptx9q4sWQ9RjGtu_-U2xn5lCzQOjttw6eJaq7VL4s1Xteha-lhQU9z_PVkal_8&usqp=CAU",
"91": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRny43WofbHnNhpGp9j-aZzFmmfCxjRvq6HtfJfFWvZRKjyuXk4LCYl5D3uk-eCeTtuzqQ&usqp=CAU",
"92": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTR3a5a3SRLQLN-3fXzP2J5gzFQtvf2g_vK4WJNFAbJ09NwzJdIE7CMv5aG5vV3zk64tQ&usqp=CAU",
"93": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQESxXhhB7MVuxNPCnWD_X6mgqBMMpqaUiq2RVgrQ_u4QyZ-Zv6-KzSfKBoWtT_1Zn3M5A&usqp=CAU",
"94": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQSMA3auz15eWdsUQMQAEKhi3hH8kz1PTLhArKv-FE1yTpNaaE497O5EPY9AzASAxdGh1M&usqp=CAU",
"95": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTOKh7Ue7mQVUNtLGAYbFJ8JabSsMB766_OXWU2HPBL2q-1ymAdTSHBFzfPvc22hJrOKrA&usqp=CAU",
"96": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjeDkKZW1D1sSIrNMsyv0JFEAExZ7SWxHGQmkr1loDypuEOyxhm6R9fH_x63PBJoooitQ&usqp=CAU",
"97": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ4M6NJP-9EQduJ84NsKfiCTumjyG5o_AdLrwPn0d3ng0-ZtZTwwSQtBU6Bok9ClL81JbM&usqp=CAU",
"98": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTJZdlR9pbrQ9NcNGZ3kSocsaHSFtIKZTobyufHH2jymgajlzrL6et7gNKypb3_Fnf1RIo&usqp=CAU",
"99": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRm2U9hEWee88Z84TEgYcVimTEVqjuMyoXkmYvRZAr3GDwDim3NOhhCOW-L1KYuyufmp5A&usqp=CAU",
"100": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQi4RzkMQgH44rIgqLhQT9NcoI3-fzpCyg4Ew&usqp=CAU",
"101": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS4w6kbLoSnXktGo7vBlr_A4EXhQXgnOdoT_g&usqp=CAU",
"102": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQoas6x28nB-DfSWm7q5yVk_X2i_5vsEs0hNw&usqp=CAU",
"103": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTXqkhu8V5DmWazrp3Oi1vnUIQzxa8zNuveJA&usqp=CAU",
"104": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSv7BjsDz8m4S4IfeSh_wUiQRaI-173-XQ9jA&usqp=CAU",
"105": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTih2tHkZg6enF8zuNEWYicbmkelCUSnks9tQ&usqp=CAU",
"106": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQYPpXEGFyxj0uSW0XkYcyRSGDRzzRCR0grxg&usqp=CAU",
"107": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSwHhumy-e8YdukspnP49gedYrzJttYPpdTqg&usqp=CAU",
"108": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ_v3P0F6DltZjYMLbZ7MR5WcqkUGY0ifW1fw&usqp=CAU",
"109": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRIjjeEvePntcVN2QuimRv00J_SmoqhMQt6zQ&usqp=CAU",
"110": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTwvbzPMKTT1upzYgDT_tox4nfVSrwd1n4RoA&usqp=CAU",
"111": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS-P1IKKg-KD9Oh3kwQwfVtHJnSfRfsBuDhFQ&usqp=CAU",
"112": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRCFsk2r5PODfINsC_9GmClRJ8vLqp9tTAb_w&usqp=CAU",
"113": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRytjjA6cyYPI7jjODg7nU6kIb__afXQ3WBPA&usqp=CAU",
"114": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQLm5XVcUlwE0mYpfULTOnCh1cfNPv_iP2t7g&usqp=CAU",
"115": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQh_ikOZ2uH0OreJMC7Z1lTcUiVQING-VeIvw&usqp=CAU",
"116": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRuw7-CCOFdb2zXe3Tc_dnbMq6DWMS6LsLxuw&usqp=CAU",
"117": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTXqkhu8V5DmWazrp3Oi1vnUIQzxa8zNuveJA&usqp=CAU",
"118": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRdfQzmqqEo43RQTJvgylfdZmYkpTVSwKLALQ&usqp=CAU",
"119": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAiNwcKYNwjSO1KYBHfdVhjSUD1Nlwat--og&usqp=CAU",
"120": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSbLUY_GpI8vLtnjDuEeGXOpUUSbI1_41kgyQ&usqp=CAU",
"121": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcScWiB0qmrq1EO00HRv2wugJQOdDVL6jsnJgA&usqp=CAU",
"122": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQzTV1iSzVr9Y9eswADXf3IGkQ5-GpCrBgDaQ&usqp=CAU",
"123": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTvR_Kh1glzoOatIKyKJhyg9dOotvOxAIxIrQ&usqp=CAU",
"124": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRsvjnRbqv6Fb4IoSerY_DKL13aLetgvFj4CA&usqp=CAU",
"125": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQP4im01HJvCQ3Mb6--ilO02ZJ2gD78j-XlzA&usqp=CAU",
"126": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQSfkpTF904XmF8d2Krl_QeNLYmk5DhSyeWJA&usqp=CAU",
"127": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQoas6x28nB-DfSWm7q5yVk_X2i_5vsEs0hNw&usqp=CAU",
"128": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSudw5QQ3vmB0UbvLNMRAbvTSjSBxnEl-G2jg&usqp=CAU",
"129": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwRJlo__ltilwtR2D_6uufz8lGbOrVnNFVKQ&usqp=CAU",
"130": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTih2tHkZg6enF8zuNEWYicbmkelCUSnks9tQ&usqp=CAU",
"131": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQf0fCyjg4vzOczzcomunZT5wk1LbHya3qTA&usqp=CAU",
"132": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdF6kXiofrcXiMyrLLRODsRe09v4ifKdZ4jg&usqp=CAU",
"133": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTUIjRupmR0QP6L7fau1UT8q_Ilw_zKswZi3A&usqp=CAU",
"134": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRL1EeTf6sTJJOrnXguF-9YjmB14j7o1MRdjQ&usqp=CAU",
"135": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAu4dYhJL32aXRUxJKJC4GpLKNekLDbPxUBQ&usqp=CAU",
"136": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFxcU3BzbJbBPXkRzh6sXvrfX5FkXDPVzMgQ&usqp=CAU",
"137": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTpPj2Xjzv02svymH1xKmtHwsC22PEAFoLcmQ&usqp=CAU",
"138": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQsgC9GIqTXnqPtyKc6Cs6lI62wD4pc8XDJCg&usqp=CAU",
"139": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNajCGwakMfXVVTTQMt8wtf6YAOhpq4jx1VA&usqp=CAU",
"140": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQBU2L9XwPOJWa_z-GFJgt9ntd1SSQ1y835cw&usqp=CAU",
"141": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTq4medtOuzYpHGb22aHQIYSf-LpHWCUyGJ8A&usqp=CAU",
"142": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTqYWfgwbvxQy_hi7rS3-kuR8Rb9_SO3QspaQ&usqp=CAU",
"143": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjt8hI1yJj9RB4xbfWpFiCvGSCuv8LNtgOSg&usqp=CAU",
"144": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRAN3I3i9cjaVh_fM8P4hyjjT1nppMly4nHXQ&usqp=CAU",
"145": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRD7i7SviGTXxAvO6Hp3Wzp6CauQSXD_CYCEw&usqp=CAU",
"146": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQRWq4vtmIMXt7RKENmr5X5lcNOhRL6PzEQg&usqp=CAU",
"147": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMx1vpitw7az3JApZG5azshVMhD2vkk-XD0w&usqp=CAU",
"148": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSlLxfkCIKD3i_PBGjqWQJlp72RzHUD1KvA_w&usqp=CAU",
"149": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSQ_zT723jLpkHNhAtxM-0jzuo1KvqOvN9mVw&usqp=CAU",
"150": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTlE-2ard1gxmekxjUaESqp7qQyRPzVGzjyug&usqp=CAU",
"151": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhhmFWu9lCiMjduwtPZVdTj7wPuLMczprUEw&usqp=CAU",
"152": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR51QQ6V3IGAz5sFssx4GFfwPJnSVbTopl_-w&usqp=CAU",
"153": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTLxa9tVzkosh7udU53CJF-gFNpNkiwkr8R9Q&usqp=CAU",
"154": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTv2qQqIbByxCj4tOlo2aspTK90YRZXHAbSmg&usqp=CAU",
"155": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwd-Fwiu4uU6sB8DLKAKYuyUp0ZfAS2AQutg&usqp=CAU",
"156": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSmcim5iUpgxdf7Ggiq_AAoP6yjCUSjfG-L2A&usqp=CAU",
"157": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQB0M2aYhRAnWWZL1ID0ndNz0FxojtqYSCZ6A&usqp=CAU",
"158": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSMhgBBVtyFiIZYKbchwqtlnf-R0i-y8LJ6kA&usqp=CAU",
"159": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRI4ezjLdOvQtBusl9NIANPzkRD2cxUDSUvVA&usqp=CAU",
"160": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSygRLnf27CNEccUgxb9rcddo1argImCCfNNA&usqp=CAU",
"161": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQbzTwm03eicgyJ5mQTpWSbqpZnMc-zV91RjA&usqp=CAU",
"162": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQChMNDSjvoz13y3PJYoMdkFstsPZsR6PKs0g&usqp=CAU",
"163": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSjcC-QBOngGrfyoHYUsXbdn-MtDC2yBJDqOw&usqp=CAU",
"164": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSnh7Em06jR9TGM8mmu-CMxbqp0N7aD55Q1jQ&usqp=CAU",
"165": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRHR6R2N9RpU1HvCX5Rvq1XyR_8rSlqHmPWQQ&usqp=CAU",
"166": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRSpDnHDWiekEmL7prA-w7OwcZfCJhj0NTKGw&usqp=CAU",
"167": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSZcnvemZrceyQiht2inAFdA-KNqkA1q3IAaA&usqp=CAU",
"168": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFsYoFDB8HkdsFHTrW5Xu9L-irlIsWQBBt_Q&usqp=CAU",
"169": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQOdd_TP6FUroT_Fm1QEHHIEHzRi-XGHiksmQ&usqp=CAU",
"170": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQLsroH69Yk1G12k-iVXomuSstLRcQmHB44DA&usqp=CAU",
"171": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRuChXdxV2Gb6-GM4e0UCIklI6u4Rv8PrWHbg&usqp=CAU",
"172": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTevGj9oQ_0Wu37SUbv0bf-jnl-rnrAFQjUGQ&usqp=CAU",
"173": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTT78mZMYF8F2Zc0sAMn6udX32MZg6Blah80Q&usqp=CAU",
"174": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJ9hMmPualV1xiscBZKfYwIH7LT-hxG_HKGw&usqp=CAU",
"175": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRwxwfitUiMvmCAHnzvbTgoCcLkSwSPf519Zg&usqp=CAU",
"176": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT8MkhaNbQkQ8lNBWUPez5vZXv5lAUcmZBXJA&usqp=CAU",
"177": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRczgzFZ4Dgea_DVBby3GNhcLF0PTqRvflj7Q&usqp=CAU",
"178": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTELZ4dmWXkkZqDRM92mdoQj__wpQX_WQpdRxUREY2HJNiKcwDk18EwP0Nytid02gPb-Rw&usqp=CAU",
"179": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT8MkhaNbQkQ8lNBWUPez5vZXv5lAUcmZBXJA&usqp=CAU",
"180": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSPXBETDGiKnA89MO-Pc2zu8B7qiKvfbAIJO-Bp5kgg6UyIMj8P4P0u29XpSA9HykwJl1M&usqp=CAU",
"181": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQFhv7Vfri-mxq52QGbcZumaQnumRivIINiK5xhxqIVKSdHBYNrQI5ZTEsuIfdNzfRdjhY&usqp=CAU",
"182": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTELZ4dmWXkkZqDRM92mdoQj__wpQX_WQpdRxUREY2HJNiKcwDk18EwP0Nytid02gPb-Rw&usqp=CAU",
"183": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRczgzFZ4Dgea_DVBby3GNhcLF0PTqRvflj7Q&usqp=CAU",
"184": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2tuKIBCWZaSJlgBLIOO4oiMQJd9U_MZ085-ZMe9lFIEPTlA2ctKzv6Bbg1Nk9d61vFg8&usqp=CAU",
"185": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNYNm6xyQ_2F0PT1530mT9nj1WpkMfRGPKoA9y5dP7WwIk-tDqnJzjylZ-PmdDD5d3dQA&usqp=CAU",
"186": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQJhKvIchqYRdPDKBBlwP_lWfP3PPBYtvKAF5Lp-tiFCunJw2SKSjuXvFg1ddZsoAMG_b0&usqp=CAU",
"187": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSQMUPPAupAatr6rMJL_MZrOci6yBtBtMDsO-67GSOEZBVQkftaq33qmoQ82RBR_Dei5w4&usqp=CAU",
"188": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQFARvOrqz2JfVwf-DbHMTQr5XrlBQH95f0VgSXnBlHOXU9Kh0Zj2xNvuMSwbAjR9PXPio&usqp=CAU",
"189": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT5N6n-CjhKo1DGoSADV0yJMVOGC4b0hrMjYenUYQgxZ_ejhnY2VA4AR8U0V2WORW6M7FM&usqp=CAU",
"190": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS5SXUTEuNv7nGeRxBDSszkOrH45LiyjWXM3qAlm1q4Z63XoedBICsBgWaqBVXR3Z1D36o&usqp=CAU",
"191": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS09ugMOP3eEbse9DQeF37vcOrq4VGKo8xbeAwXrEOqB_HaZ6aZcT-FV7VbdFUeUNNAQxs&usqp=CAU",
"192": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQBu3jaG0oKLFrHmoY3r7yoXHLMIEfQIIm61GdkmnGC-6TzXFNmMaThiJxhM8yxdd5fUo&usqp=CAU",
"193": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7F6jci1vlEzfyGcMPOGgYsKtrMi_PjfhgOe93lNUOvlJbVWb-zwf7hntFHXHLF-swL30&usqp=CAU",
"194": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRmNwhIod8s-4ptYr21dg724poCavNuyrwr0C_WNsZ1_bHLf2zK0O75Ju7s67kvperFbp4&usqp=CAU",
"195": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTa1xXIZYWrIEkVFnGhgjm_xMFs1C9Cu3E3SQjXcqpZXTtAxv-VzyCYEki2HMNwzaTxX7g&usqp=CAU",
"196": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRlgPFT5cE9c_-ZULn6WqwlD0ZqOfLVC6mFsZ0fycET0Dmyf6gWMEKAF-oTLEof6MVDuMw&usqp=CAU",
"197": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTu7ED7-P3yNC2DIZWXVZQQ_FQ-RGVmdgjB2rFsHddpzMTmPDlMjuGozWlLK-vgIAhTbEs&usqp=CAU",
"198": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQJg4fZLZUuVv5wUXdDSA5cLsMvbhnD3M13vw&usqp=CAU",
"199": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQb2U5TLaYFsLl3fgvOZJA5Gh1GOBLVzfY0yQ&usqp=CAU",
"200": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTL94eCu4Hos6lI4Hi6zrEPmvN2ce5UTTqWKw&usqp=CAU",
"201": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQRr1WlHqMzSDQvNhl6dZ0tCAcHbetAx7hMtA&usqp=CAU",
"202": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRBeBJdxjwSxAswREy56t7X1Y9hhwm0wQvHyg&usqp=CAU",
"203": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSL9_8uDnHVUCA9sRoyNazPksxeMekyXcysJA&usqp=CAU",
"204": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5VTUHOpBZUiZM9EvCWv-z15T0Z2OBmUp7MA&usqp=CAU",
"205": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRh-jfSlOpnXQIfDommsI2xu57gKep9HKKEWw&usqp=CAU",
"206": "The rest of the results might not be what you're looking for."
}

@ -1,120 +0,0 @@
import selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import requests
import os
import io
import json
import random
import json
DRIVER_PATH = '../geckodriver'
DRIVER_PATH2 = '../chromedriver'
def harvesting(query:str, max_links_to_fetch:int, wd:webdriver, sleep_between_interactions:int=1):
dictionary = open('pics.json',)
l = json.load(dictionary)
cycles = 10
def scroll_to_end(wd):
wd.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(sleep_between_interactions)
# build the google query
search_url = "https://www.google.com/search?safe=off&site=&tbm=isch&source=hp&q={q}&oq={q}&gs_l=img"
# load the page
wd.get(search_url.format(q=query))
image_urls = set()
image_count = 0
results_start = 0
sx ="sx"
dx="dx"
while image_count < max_links_to_fetch:
for loop in range(cycles):
scroll_to_end(wd)
time.sleep(.1)
# get all image thumbnail results
thumbnail_results = wd.find_elements(By.CLASS_NAME,"Q4LuWd")
number_results = len(thumbnail_results)
print(f"Found: {number_results} search results. Extracting links from {results_start}:{number_results}")
# some useful variables
nPic = 0
holdPic=0
groundPic = 0
currentMeta = ''
for img in thumbnail_results[results_start:number_results]:
# click the thumbnail to get the actual image
try:
img.click()
time.sleep(.1)
except Exception:
continue
# extract image url
actual_images = wd.find_elements(By.CLASS_NAME,'n3VNCb')
actual_image = actual_images[-1]
if actual_image.get_attribute('src') and 'http' in actual_image.get_attribute('src'):
image_urls.add(actual_image.get_attribute('src'))
linkPic = actual_image.get_attribute('src')
#
# print(linkPic)
l[nPic] = linkPic
time.sleep(.2)
# print(l)
with open("pics.json", "w") as outfile:
json.dump(l, outfile)
nPic = nPic+1
holdPic = holdPic+1
time.sleep(.2)
image_count = len(image_urls)
if len(image_urls) >= max_links_to_fetch:
print(f"Found: {len(image_urls)} image links, done!")
break
else:
print("Found:", len(image_urls), "image links, looking for more ...")
time.sleep(1)
return
load_more_button = wd.find_element(By.CLASS_NAME,"Mye4qd")
if load_more_button:
wd.execute_script("document.querySelector('.mye4qd').click();")
# move the result startpoint further down
results_start = len(thumbnail_results)
return image_urls
if __name__ == '__main__':
wd = webdriver.Firefox(executable_path=DRIVER_PATH)
query = "VAAST COLSON"
wd.get('https://google.com')
time.sleep(.3)
wd.find_element(By.ID,'W0wltc').click()
time.sleep(.5)
search_box = wd.find_element(By.CLASS_NAME,'gLFyf')
search_box.send_keys(query)
links = harvesting(query,2000,wd)
wd.quit()

@ -1,3 +0,0 @@
home = /Library/Developer/CommandLineTools/usr/bin
include-system-site-packages = false
version = 3.9.6

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,3 @@
cd pics/ &&
source bin/activate &&
flask run

@ -0,0 +1,247 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)
<# Function declarations --------------------------------------------------- #>
<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}
# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}
# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}
# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}
# Just remove VIRTUAL_ENV_PROMPT altogether.
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
}
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}
# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}
<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }
if ($pyvenvConfigPath) {
Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]
# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}
$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}
<# Begin Activate script --------------------------------------------------- #>
# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}
# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}
Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"
# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Verbose "Setting prompt to '$Prompt'"
# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
$env:VIRTUAL_ENV_PROMPT = $Prompt
}
# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}
# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"

@ -0,0 +1,69 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/poni/harvesting_the_net/pics"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(pics) ${PS1:-}"
export PS1
VIRTUAL_ENV_PROMPT="(pics) "
export VIRTUAL_ENV_PROMPT
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

@ -0,0 +1,26 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/poni/harvesting_the_net/pics"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(pics) $prompt"
setenv VIRTUAL_ENV_PROMPT "(pics) "
endif
alias pydoc python -m pydoc
rehash

@ -0,0 +1,66 @@
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
# (https://fishshell.com/); you cannot run it directly.
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
set -e VIRTUAL_ENV
set -e VIRTUAL_ENV_PROMPT
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/Users/poni/harvesting_the_net/pics"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset PYTHONHOME if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# Save the current fish_prompt function as the function _old_fish_prompt.
functions -c fish_prompt _old_fish_prompt
# With the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command.
set -l old_status $status
# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(pics) " (set_color normal)
# Restore the return status of the previous command.
echo "exit $old_status" | .
# Output the original/"old" prompt.
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
set -gx VIRTUAL_ENV_PROMPT "(pics) "
end

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from dotenv.__main__ import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from flask.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_core.command import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_client.kernelapp import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_client.kernelspecapp import KernelSpecApp
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(KernelSpecApp.launch_instance())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_core.migrate import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_client.runapp import RunApp
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(RunApp.launch_instance())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from jupyter_core.troubleshoot import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from charset_normalizer.cli.normalizer import cli_detect
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli_detect())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pygments.cmdline import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1 @@
python3.10

@ -0,0 +1 @@
python3.10

@ -0,0 +1 @@
/usr/local/opt/python@3.10/bin/python3.10

@ -0,0 +1,8 @@
#!/Users/poni/harvesting_the_net/pics/bin/python3.10
# -*- coding: utf-8 -*-
import re
import sys
from tqdm.cli import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

@ -0,0 +1,28 @@
Copyright 2010 Pallets
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,126 @@
Metadata-Version: 2.1
Name: Flask
Version: 2.1.2
Summary: A simple framework for building complex web applications.
Home-page: https://palletsprojects.com/p/flask
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
Maintainer: Pallets
Maintainer-email: contact@palletsprojects.com
License: BSD-3-Clause
Project-URL: Donate, https://palletsprojects.com/donate
Project-URL: Documentation, https://flask.palletsprojects.com/
Project-URL: Changes, https://flask.palletsprojects.com/changes/
Project-URL: Source Code, https://github.com/pallets/flask/
Project-URL: Issue Tracker, https://github.com/pallets/flask/issues/
Project-URL: Twitter, https://twitter.com/PalletsTeam
Project-URL: Chat, https://discord.gg/pallets
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Flask
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE.rst
Requires-Dist: Werkzeug (>=2.0)
Requires-Dist: Jinja2 (>=3.0)
Requires-Dist: itsdangerous (>=2.0)
Requires-Dist: click (>=8.0)
Requires-Dist: importlib-metadata (>=3.6.0) ; python_version < "3.10"
Provides-Extra: async
Requires-Dist: asgiref (>=3.2) ; extra == 'async'
Provides-Extra: dotenv
Requires-Dist: python-dotenv ; extra == 'dotenv'
Flask
=====
Flask is a lightweight `WSGI`_ web application framework. It is designed
to make getting started quick and easy, with the ability to scale up to
complex applications. It began as a simple wrapper around `Werkzeug`_
and `Jinja`_ and has become one of the most popular Python web
application frameworks.
Flask offers suggestions, but doesn't enforce any dependencies or
project layout. It is up to the developer to choose the tools and
libraries they want to use. There are many extensions provided by the
community that make adding new functionality easy.
.. _WSGI: https://wsgi.readthedocs.io/
.. _Werkzeug: https://werkzeug.palletsprojects.com/
.. _Jinja: https://jinja.palletsprojects.com/
Installing
----------
Install and update using `pip`_:
.. code-block:: text
$ pip install -U Flask
.. _pip: https://pip.pypa.io/en/stable/getting-started/
A Simple Example
----------------
.. code-block:: python
# save this as app.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, World!"
.. code-block:: text
$ flask run
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Contributing
------------
For guidance on setting up a development environment and how to make a
contribution to Flask, see the `contributing guidelines`_.
.. _contributing guidelines: https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst
Donate
------
The Pallets organization develops and supports Flask and the libraries
it uses. In order to grow the community of contributors and users, and
allow the maintainers to devote more time to the projects, `please
donate today`_.
.. _please donate today: https://palletsprojects.com/donate
Links
-----
- Documentation: https://flask.palletsprojects.com/
- Changes: https://flask.palletsprojects.com/changes/
- PyPI Releases: https://pypi.org/project/Flask/
- Source Code: https://github.com/pallets/flask/
- Issue Tracker: https://github.com/pallets/flask/issues/
- Website: https://palletsprojects.com/p/flask/
- Twitter: https://twitter.com/PalletsTeam
- Chat: https://discord.gg/pallets

@ -0,0 +1,52 @@
../../../bin/flask,sha256=-mgJ9clDHQUA0qjNIQnZHU3MBtfFrLdVBfaKpdC_vrY,242
Flask-2.1.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
Flask-2.1.2.dist-info/LICENSE.rst,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475
Flask-2.1.2.dist-info/METADATA,sha256=V3wRBN5pAKumPcu41b-ePUWUQkdyka_WVPXwMKGvLGQ,3907
Flask-2.1.2.dist-info/RECORD,,
Flask-2.1.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
Flask-2.1.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
Flask-2.1.2.dist-info/entry_points.txt,sha256=s3MqQpduU25y4dq3ftBYD6bMVdVnbMpZP-sUNw0zw0k,41
Flask-2.1.2.dist-info/top_level.txt,sha256=dvi65F6AeGWVU0TBpYiC04yM60-FX1gJFkK31IKQr5c,6
flask/__init__.py,sha256=hutpl3wZCIHR-FckBdDZMe_pw89k7llUTj7c7t77cWc,2207
flask/__main__.py,sha256=bYt9eEaoRQWdejEHFD8REx9jxVEdZptECFsV7F49Ink,30
flask/__pycache__/__init__.cpython-310.pyc,,
flask/__pycache__/__main__.cpython-310.pyc,,
flask/__pycache__/app.cpython-310.pyc,,
flask/__pycache__/blueprints.cpython-310.pyc,,
flask/__pycache__/cli.cpython-310.pyc,,
flask/__pycache__/config.cpython-310.pyc,,
flask/__pycache__/ctx.cpython-310.pyc,,
flask/__pycache__/debughelpers.cpython-310.pyc,,
flask/__pycache__/globals.cpython-310.pyc,,
flask/__pycache__/helpers.cpython-310.pyc,,
flask/__pycache__/logging.cpython-310.pyc,,
flask/__pycache__/scaffold.cpython-310.pyc,,
flask/__pycache__/sessions.cpython-310.pyc,,
flask/__pycache__/signals.cpython-310.pyc,,
flask/__pycache__/templating.cpython-310.pyc,,
flask/__pycache__/testing.cpython-310.pyc,,
flask/__pycache__/typing.cpython-310.pyc,,
flask/__pycache__/views.cpython-310.pyc,,
flask/__pycache__/wrappers.cpython-310.pyc,,
flask/app.py,sha256=b6_j0OtlrssZ05fMReHNwzSLN3M7mkI9LR8UWuhcm0g,82070
flask/blueprints.py,sha256=W2C5eFciX2Zq8zJSKQHiQd488Ytcsrt6wcXSZ-rSU7c,23362
flask/cli.py,sha256=eCZMiAFr6quTZo2pZ5RH2NBS1cQEZqLke9MCloOVIMA,31185
flask/config.py,sha256=IWqHecH4poDxNEUg4U_ZA1CTlL5BKZDX3ofG4UGYyi0,12584
flask/ctx.py,sha256=smANecq_Tr3FFi2UMDs3Nn-xYi9GhKrzZvFpkDqXtLM,18336
flask/debughelpers.py,sha256=parkDxfxxGZZAOGSumyrGLCTKcws86lJ2X3RqikiwUE,6036
flask/globals.py,sha256=cWd-R2hUH3VqPhnmQNww892tQS6Yjqg_wg8UvW1M7NM,1723
flask/helpers.py,sha256=qkbHG_6-Ox_uDmmD8ZwA9k4nTI8Q8U5S_6QtXpzZCRg,29266
flask/json/__init__.py,sha256=jZHbiHKOICmnMttYIhHYrCj2LeHjZY-J7KiYoorjc4I,10394
flask/json/__pycache__/__init__.cpython-310.pyc,,
flask/json/__pycache__/tag.cpython-310.pyc,,
flask/json/tag.py,sha256=fys3HBLssWHuMAIJuTcf2K0bCtosePBKXIWASZEEjnU,8857
flask/logging.py,sha256=1o_hirVGqdj7SBdETnhX7IAjklG89RXlrwz_2CjzQQE,2273
flask/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
flask/scaffold.py,sha256=vFn4R_sDhaWwxH77UGmRUWgE2p9tzj9VqRHG5dvE7wM,32545
flask/sessions.py,sha256=y0f1WBTQqjebkjtiT6d0G_ejIvllsjzch5sq_NUoXec,15834
flask/signals.py,sha256=H7QwDciK-dtBxinjKpexpglP0E6k0MJILiFWTItfmqU,2136
flask/templating.py,sha256=6rcyoV-Z57uBGMB6_xl4LhQJHbF456naf-GU8pjQSPM,5659
flask/testing.py,sha256=mfyDupACHNQinATGAcrqqDst9Ik4CnNg3rP9gvpUjks,10385
flask/typing.py,sha256=P1x3WCUYE7ddMNCUVqr04V5EjJy4M0Osz1MfVM0xgMQ,2116
flask/views.py,sha256=nhq31TRB5Z-z2mjFGZACaaB2Et5XPCmWhWxJxOvLWww,5948
flask/wrappers.py,sha256=Vgs2HlC8WNUOELQasV-Xad8DFTFwJe3eUltZG9z4Cu8,5675

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.37.1)
Root-Is-Purelib: true
Tag: py3-none-any

@ -0,0 +1,155 @@
"""
IPython: tools for interactive and parallel computing in Python.
https://ipython.org
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
# Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import sys
#-----------------------------------------------------------------------------
# Setup everything
#-----------------------------------------------------------------------------
# Don't forget to also update setup.py when this changes!
if sys.version_info < (3, 8):
raise ImportError(
"""
IPython 8+ supports Python 3.8 and above, following NEP 29.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Python 3.3 and 3.4 were supported up to IPython 6.x.
Python 3.5 was supported with IPython 7.0 to 7.9.
Python 3.6 was supported with IPython up to 7.16.
Python 3.7 was still supported with the 7.x branch.
See IPython `README.rst` file for more information:
https://github.com/ipython/ipython/blob/main/README.rst
"""
)
#-----------------------------------------------------------------------------
# Setup the top level names
#-----------------------------------------------------------------------------
from .core.getipython import get_ipython
from .core import release
from .core.application import Application
from .terminal.embed import embed
from .core.interactiveshell import InteractiveShell
from .utils.sysinfo import sys_info
from .utils.frame import extract_module_locals
# Release data
__author__ = '%s <%s>' % (release.author, release.author_email)
__license__ = release.license
__version__ = release.version
version_info = release.version_info
# list of CVEs that should have been patched in this release.
# this is informational and should not be relied upon.
__patched_cves__ = {"CVE-2022-21699"}
def embed_kernel(module=None, local_ns=None, **kwargs):
"""Embed and start an IPython kernel in a given scope.
If you don't want the kernel to initialize the namespace
from the scope of the surrounding function,
and/or you want to load full IPython configuration,
you probably want `IPython.start_kernel()` instead.
Parameters
----------
module : types.ModuleType, optional
The module to load into IPython globals (default: caller)
local_ns : dict, optional
The namespace to load into IPython user namespace (default: caller)
**kwargs : various, optional
Further keyword args are relayed to the IPKernelApp constructor,
allowing configuration of the Kernel. Will only have an effect
on the first embed_kernel call for a given process.
"""
(caller_module, caller_locals) = extract_module_locals(1)
if module is None:
module = caller_module
if local_ns is None:
local_ns = caller_locals
# Only import .zmq when we really need it
from ipykernel.embed import embed_kernel as real_embed_kernel
real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
def start_ipython(argv=None, **kwargs):
"""Launch a normal IPython instance (as opposed to embedded)
`IPython.embed()` puts a shell in a particular calling scope,
such as a function or method for debugging purposes,
which is often not desirable.
`start_ipython()` does full, regular IPython initialization,
including loading startup files, configuration, etc.
much of which is skipped by `embed()`.
This is a public API method, and will survive implementation changes.
Parameters
----------
argv : list or None, optional
If unspecified or None, IPython will parse command-line options from sys.argv.
To prevent any command-line parsing, pass an empty list: `argv=[]`.
user_ns : dict, optional
specify this dictionary to initialize the IPython user namespace with particular values.
**kwargs : various, optional
Any other kwargs will be passed to the Application constructor,
such as `config`.
"""
from IPython.terminal.ipapp import launch_new_instance
return launch_new_instance(argv=argv, **kwargs)
def start_kernel(argv=None, **kwargs):
"""Launch a normal IPython kernel instance (as opposed to embedded)
`IPython.embed_kernel()` puts a shell in a particular calling scope,
such as a function or method for debugging purposes,
which is often not desirable.
`start_kernel()` does full, regular IPython initialization,
including loading startup files, configuration, etc.
much of which is skipped by `embed()`.
Parameters
----------
argv : list or None, optional
If unspecified or None, IPython will parse command-line options from sys.argv.
To prevent any command-line parsing, pass an empty list: `argv=[]`.
user_ns : dict, optional
specify this dictionary to initialize the IPython user namespace with particular values.
**kwargs : various, optional
Any other kwargs will be passed to the Application constructor,
such as `config`.
"""
import warnings
warnings.warn(
"start_kernel is deprecated since IPython 8.0, use from `ipykernel.kernelapp.launch_new_instance`",
DeprecationWarning,
stacklevel=2,
)
from ipykernel.kernelapp import launch_new_instance
return launch_new_instance(argv=argv, **kwargs)

@ -0,0 +1,14 @@
# encoding: utf-8
"""Terminal-based IPython entry point.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
from IPython import start_ipython
start_ipython()

@ -0,0 +1,87 @@
import builtins
import inspect
import os
import pathlib
import shutil
import sys
import types
import pytest
# Must register before it gets imported
pytest.register_assert_rewrite("IPython.testing.tools")
from .testing import tools
def pytest_collection_modifyitems(items):
"""This function is automatically run by pytest passing all collected test
functions.
We use it to add asyncio marker to all async tests and assert we don't use
test functions that are async generators which wouldn't make sense.
"""
for item in items:
if inspect.iscoroutinefunction(item.obj):
item.add_marker("asyncio")
assert not inspect.isasyncgenfunction(item.obj)
def get_ipython():
from .terminal.interactiveshell import TerminalInteractiveShell
if TerminalInteractiveShell._instance:
return TerminalInteractiveShell.instance()
config = tools.default_config()
config.TerminalInteractiveShell.simple_prompt = True
# Create and initialize our test-friendly IPython instance.
shell = TerminalInteractiveShell.instance(config=config)
return shell
@pytest.fixture(scope='session', autouse=True)
def work_path():
path = pathlib.Path("./tmp-ipython-pytest-profiledir")
os.environ["IPYTHONDIR"] = str(path.absolute())
if path.exists():
raise ValueError('IPython dir temporary path already exists ! Did previous test run exit successfully ?')
path.mkdir()
yield
shutil.rmtree(str(path.resolve()))
def nopage(strng, start=0, screen_lines=0, pager_cmd=None):
if isinstance(strng, dict):
strng = strng.get("text/plain", "")
print(strng)
def xsys(self, cmd):
"""Replace the default system call with a capturing one for doctest.
"""
# We use getoutput, but we need to strip it because pexpect captures
# the trailing newline differently from commands.getoutput
print(self.getoutput(cmd, split=False, depth=1).rstrip(), end="", file=sys.stdout)
sys.stdout.flush()
# for things to work correctly we would need this as a session fixture;
# unfortunately this will fail on some test that get executed as _collection_
# time (before the fixture run), in particular parametrized test that contain
# yields. so for now execute at import time.
#@pytest.fixture(autouse=True, scope='session')
def inject():
builtins.get_ipython = get_ipython
builtins._ip = get_ipython()
builtins.ip = get_ipython()
builtins.ip.system = types.MethodType(xsys, ip)
builtins.ip.builtin_trap.activate()
from .core import page
page.pager_page = nopage
# yield
inject()

@ -0,0 +1,12 @@
"""
Shim to maintain backwards compatibility with old IPython.consoleapp imports.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from warnings import warn
warn("The `IPython.consoleapp` package has been deprecated since IPython 4.0."
"You should import from jupyter_client.consoleapp instead.", stacklevel=2)
from jupyter_client.consoleapp import *

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save