Skip to main content

All Questions

Tagged with
1 vote
1 answer
1k views

peewee - change schema dynamically

I have the same question/problem than this post -> peewee - modify db model meta (e.g. schema) dynamically . I want to change the schema field in my Meta class dynamically. This is my code: class ...
dtamab's user avatar
  • 85
1 vote
1 answer
5k views

Get the list of registered gRPC service name and methods in python

grpc-core for java has the option of getting a list of service descriptors from the grpc server object. From it we can gather the service name and method names. for (ServerServiceDefinition ...
onesiumus's user avatar
  • 309
0 votes
0 answers
392 views

How to get past a circular meta refresh with Requests?

I'm trying to web scrape using Requests. My code so far is the usual: import requests html = requests.get('https://www.sampleurl.com').text This gives: <!DOCTYPE HTML PUBLIC "-//...
chickychocks's user avatar
0 votes
0 answers
167 views

django admin attribute to override error_message in modelForm Meta for Regex, and variables in error_message strings

I've got some validators defined on my ModelForm in Django Admin: class AddressesAdminForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(AddressesAdminForm, self).__init__(*...
arc's user avatar
  • 37
0 votes
1 answer
871 views

Edit Meta Data of Image Python [closed]

I am taking a picture with opencv, and all of the image properties of the pictures it takes are not set. I need to set the camera make, model, and focal length. I am using python 2.7. I have looked at ...
figbar's user avatar
  • 764
3 votes
3 answers
143 views

python get parameters of passed function

I want to pass a function, f(a=1,b=2) into g and use the 'a' value in g def f(a,b): pass def g(f): #print f.a g(f(1,2)) should result in an output of 1 I looked into the inspect module but can't ...
smithsomizm's user avatar
1 vote
1 answer
1k views

driver.page_source returns only meta name="ROBOTS" content="NOINDEX, NOFOLLOW" using Selenium

I want to scrape one website, to get the page content with this code: from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities driver = webdriver....
user avatar
1 vote
2 answers
564 views

Proper way of collecting data from multiple sources for a single item

This is a thing I've been encountering very often lately. I am supposed scrape data from multiple requests for a single item. I've been using request meta to accumulate data between requests like ...
gunesevitan's user avatar
0 votes
1 answer
969 views

Wordpress API - post meta field

I am trying to create a post via WP API and I am using python to send http requests. So an example http request body would look like this: body = json.dumps(dict( slug='test', status='publish'...
Laimonas Sutkus's user avatar
3 votes
1 answer
4k views

Using Dask on an apply returning several columns (a DataFrame so)

I'm trying to use dask on an apply with a function that outputs 5 floats. I'll simplify in a example here. def func1(row, param): return float(row.Val1) * param, float(row.Val1) * np.power(param, ...
mbahin's user avatar
  • 139
0 votes
1 answer
87 views

simple scrapy based on https://github.com/scrapy/quotesbot/blob/master/quotesbot/spiders/toscrape-xpath.py not passing data using yield Request

strong textMy code based on examples that I searched did not seem to function as intended so I decided to use a working model found on github: https://github.com/scrapy/quotesbot/blob/master/quotesbot/...
jayuya's user avatar
  • 1
0 votes
1 answer
774 views

Python Meta class and inheritance -- attributes not recognized (django-tables2)

I'm trying to write a UsersTable class with django-tables2 to be sub-classed by StudentsTable. This code works fine: tables.py import django_tables2 as tables from django_tables2.utils import A # ...
ravioli's user avatar
  • 3,807
2 votes
2 answers
3k views

Django - add widget option in form.py Meta class?

models.py from django.db import models class user(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) email = models.EmailField(...
Eric Kim's user avatar
  • 2,640
3 votes
3 answers
390 views

BeautifulSoup not picking up meta tag

I have a simple script that gets an html page and tries to output the contents of the meta tag for keywords. Somehow, it is not picking up the content of the keywords meta tag even through the html ...
pseudocode425's user avatar
1 vote
1 answer
2k views

Extracting data from a meta tag beautifulsoup returning null

I trying to scrape the mileage of a car from this website https://cazana.com/uk/car/RA51GZJ The data I want is the mileage (128,375 miles) when i try to scrape this page i get nothing returned I ...
stackoverflow1234's user avatar

15 30 50 per page